STICKS - Editorial

https://www.codechef.com/viewsolution/37670070

Its giving an error. Can someone tell me why?

https://www.codechef.com/viewsolution/43322813

its giving error can someone explain?

every square is a rectangle but not vice versa

https://www.codechef.com/viewsolution/52683455
whats the error in my code? its showing wrong answer every time…

it doesnt work for the following input:
10
4 4 4 4 3 3 3 3 2 2

you did not consider the case when the repetitions are more than 4