Class Assginment Problem

Why am I getting wrong answer for all the testcases when examples give the right answer

can you please tell me what is que yours??

your logic is correct but you were numbering the in a random manner.
Corrected code

Why did you take temp and not the input??

OKAYYYY I GET IT, It’s the numbering. I got confused because of the sample input. Thanks though