Write loopIterations(shape, n) that returns the exact number of times the body of one of four loops runs, for a non-negative integer n.
"doubling": for (let i = 1; i < n; i *= 2)"halving": for (let m = n; m > 0; m = Math.floor(m / 2))"sqrt": for (let i = 2; i * i <= n; i++)"harmonic": for (let i = 1; i <= n; i++) for (let j = i; j <= n; j += i), counting the inner body
The tests use values of n up to 1012 for the first three shapes, so do not run the loop for "sqrt": work out how many steps it takes and compute that directly. The harmonic loop is checked up to n = 106.