I just tried to figure out the solution the last few hours and finally I got it,
and believe me I was really glad that the server didn't complain, because the
algorithm is very dirty and shouldn't work!
The thing is, I break my loop when the first zero is found.
Before I counted till 20 but that just took too many instructions *grml*
So, I tried that hoping that there are no zeros in the array of numbers in the tests.
And actually, it worked
For example, if there were the following numbers in the array, the algo wouldn't work:
3, 0, 876, ..........
because it would say 3 is the largest number and it would abort after seeing that there's a zero on the second place.
Here is my code:
Code: Select all
10^<0<:1+5?0^<0>1+0^<2?1c0<p