https://www.codechef.com/viewsolution/34727764
what is wrong in my code
You should still run line 33 even if there’s only one element in the list
thank you @galencolin