This comment is hidden because it contains spoiler information about the solution
You're right! I had an infinite loop and didn't notice that
My solution works fine on eclipse, but here goes in timeout (on eclipse it takes a couple of seconds to finish). Anyone knows why?
I don't get why the false condition in the ternary operator returns 2. What if the first 3 elements are equal?
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
You're right!
I had an infinite loop and didn't notice that
My solution works fine on eclipse, but here goes in timeout (on eclipse it takes a couple of seconds to finish).
Anyone knows why?
I don't get why the false condition in the ternary operator returns 2.
What if the first 3 elements are equal?