Https://www.codechef.com/viewsolution/34727764

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

3 Likes

thank you @galencolin