May cook off 2019 : HELP REQUIRED DIV2 - "Chain reaction"

I am unable to find errors in my code. Plz help.
https://www.codechef.com/viewsolution/24321801

Input:

1
3 3
1 1 1
3 1 1
1 1 1

Your Output: Stable
Expected Output: Unstable

You are not checking first and last column for condition.
I’ve made changes to your code https://ideone.com/JAQuS7
Guess it’ll work

It was such a silly mistake::joy:
By the way, Thanks::grinning: