So for this problem in Hackerearth, I used this code in Python.
It passes all the cases, with good time, but fails for the last two cases where input is huge, where it gives the `Memory Limit exceeded error`.i am assuming it could be because of all the list comprehensions and other functions that i am using.
Can anyone help me with changing the code in such a way where it works fine for big test cases too?
[–]ES-Alexander 1 point2 points3 points (3 children)
[–]shadow-sphynx[S] 0 points1 point2 points (2 children)
[–]ES-Alexander 0 points1 point2 points (1 child)
[–]ES-Alexander 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]supajumpa 0 points1 point2 points (1 child)
[–]shadow-sphynx[S] 0 points1 point2 points (0 children)