Yalalovichik Numbers - YVNUM

in the question YALALOVICHIK NUMBERS , i compared many test cases with the successful submission with my submission,all outputs are coming same for all smaller and bigger random numbers which i choose , but it still giving me wrong answer on submission

can any one help me to figure it out where i am getting wrong and why, below is the link of my answer


Input has 10^5 digits. You can’t take it as long long int. You need to take it as a string.

thanks for the answer , i misunderstood the constraint- N in place of |N|