AC solution: https://www.codechef.com/viewsolution/29567777
My solution : https://www.codechef.com/viewsolution/29567938
My logic is same but I think I have done some mistake in implementing it.
when you do x=10-sod%10, if sod|10 then x=10
so in testcase
your code will output 1910 instead of 190
ohh, ok thanks. I need to improve on these small things. Thanks once again.