Yes, it's O(n^2): you're using a single loop over O(n^2) instead of two nested loops over O(n) both with common complexity of O(n^2). Also, probably it's not so effective because it's using additional checks instead of just using built-in loops (but this should be benchmarked, not speculated), and it's much less readable; but it has the same time complexity.

There's no decimal 1.1 and 1.10000000000000009 is closer to 1.2.
The description doesn't say that input has to be rounded, it says that input is already rounded.

Yes, it's O(n^2): you're using a single loop over O(n^2) instead of two nested loops over O(n) both with common complexity of O(n^2). Also, probably it's not so effective because it's using additional checks instead of just using built-in loops (but this should be benchmarked, not speculated), and it's much less readable; but it has the same time complexity.

a*(a+1) = n*n

Ok, if you say so, what is the time complexity of my own code since maybe i don't really know about time complexity

The task is to generate O(n^2) elements. You can't do O(n^2) work in less then O(n^2) steps.

Bad practice O(n^2)

Nice kata

Because a resistor of lower value of a mili-ohm has no sense in this context.

These two lines would go to Sample Test too?

:S

Ok. I've just to include these two lines and

@test blocks

Hope this works

.

better.

There's no decimal

`1.1`

and`1.10000000000000009`

is closer to`1.2`

.The description doesn't say that input

has to berounded, it says that inputisalready rounded.## Loading more items...