One test case is giving wrong answer

what is the reason of it as i have also dealt with digit =0 case.

hello @anyamaurya
actually they are considering " " (space ) for digit 0.
so dont handle it separately. remove that if statement and let ur for loop handle everything

ur corrected code