Laptop Recommendation

I am getting wa in one test case dont know why.Please help.
https://www.codechef.com/viewsolution/64256972

Your code will fail for the test case
1
5
4 4 4 4 4
since you’re not considering the last element 4, and even if you do, you’re not adding s to the b list after traversing the array.

thanks @arnav_07