Pending doubt on Overhappy numbers logic

Could you help me with the condition that may be missed because of which test cases are failing.

hello @PThak2018
test ur code output for -> 9999999
output should be false

try printing true and false in place of 1 and 0.
because in test case file it is true and false in place of 1,0

ohhh my bad.
Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@PThak2018
You have opened the doubt again.
Do you have any issues now ?

yup. The same code is giving me run errors. It is getting accepted on leetcode.

I’ll check the cases. If it works fine on leetcode, then your algorithm is correct.

Any update on this ??