My friend sent me his code for an easy problem Voters and asked me why is he getting WA in this.
Since I have never used JAVA , I just tried changing the data structures and testing the code (since his logic was correct). Surprisingly, when I changed an ArrayList to a normal array, the code got AC.
His solution: WA
When I changed ArrayList to array: AC
Can anyone explain this?