It seems what you’ve done here is use a matrix to map frequency of voters according to their IDs. But their ids can be any number in the integer range not just upto 50000.
So your code will fail for id >50000. Perhaps you should first correct that.
Read and understand question properly. Even the comments might help.
thank u i took size of array as greatest no among the three lists and got my solution accepted