Need held to understand my mistake (HDDN)


Here is my python3 program :

I tried it on some tests cases I created and it was correct each time, I would be grateful if someone give me some test case where my solution is incorrect, or just explain me where is my mistake.


Closed as requested by user.