This is the problem
This is my solution
I think my solution matches some of the answers given by some grandmasters. However I am not able to figure out the reasons for getting MLE. I have only 3 lists of length 200000 each and I am sure this is not the reason for MLE.
If anyone can guide me it would be nice.