My solution : https://www.codechef.com/viewsolution/21670596
Hey ! I tried approaching this problem without using string ; so i used a different approach . And it pretty much works well with most of the testcases i created myself ; I am unable to figure this out .
ps: I used a very basic logic(if you are unable to figure out the logic try it out for any number)