http://www.codechef.com/viewsolution/2704177
please provide me a test case where i am getting wrong… thanks in advance…
1
4
1
1
2
right answer: <b> 1 2 3 </b>
your answer: <b> 1 2 2 </b>
2 Likes
thanx @butatov now its a tle seems to optimize it :)…
For input
1
6
1
2
3
2
5
that represents
1
|
2
/ \
3 5
/ \
4 6
return should be 4, but your code returns 3 - GTQnTa - Online C++0x Compiler & Debugging Tool - Ideone.com