Check if my idea is wrong

a sample test case is working but failing all test cases while submission