Can someone please tell me why is the memory limit exceeded in this solution.
99282970
Codeforces Round 943 Solution Discussion