What's wrong in my code's logic?

My code is passing for 3/4 test cases, and I am trying to stick to a very simple approach, hence it would be really helpful if you could let me know, for what test case or what logic is my code missing.

Input :
5
30
40
35
45
42
Expected Output :
1 2 1 4 1 END
Your code gives a different output.debug for this

Thanks for helping out promptly!

1 Like