Could someone look at my solution to lucky10 (oct long contest)

Had a hard time finding the bug in my solution. I thought my algo should work well!
I would really appreciate if someone could point out the test case which would break my code!

http://www.codechef.com/viewsolution/1456568

problem: CodeChef: Practical coding for everyone

thanks
sk

Try this one:
1
88487786847
79774772742

It seems that your program return 7777774 while the correct answer is 777777.
Really, first string has only 6 digits <=7 : 477647. So how can the answer contain 7 digits like in your output?

2 Likes

Ah my bad! such a foolish mistake.
Thanks @anton