code:
TestCase 2 and 3 not passsing
if(a[c-1]==0){
a[c-1]=first;
}
this is wrong
as if 9 comes at start you have to inverted it
while print do not print leading 0 means if input is 99995
then output should be 4 not 00004
modified still not working ,
modified code:
for(int i=0;a[i]>0;i++){
z=i;
}
it still not working as if input is 45054
then output should be 4404 but you give 44
don’t make another array
first extract digit from number and then use it to form new number
corrected the issue you mentioned , still not passing :
I have said don’t use array instead of saving it in array use it