This comment is hidden because it contains spoiler information about the solution
It can be done with a single loop
Awesome thank you for the hint. Much appreciated.
Nested loops like that won't work. Your code should work in linear time.
Nice tenacity! I learned a lot too, my solution wasn't near as efficient and clean as it could have been, was inspired by the other warrior's solutions.
Thanks, I got the problem!
Your code is returning the numbers in the wrong order in that test.
Loved solving this kata. It took me two weeks and several algorithms to solve it efficiently, but that helped me learn a lot. Thank you!
I'm pretty sure theres a bug in the random tests.
n=1 should return 1 but it's expecting 2 some how.
Testing for n = 1