Diffcheck between the two codes (first, second) shows that only an extra println statement is present in the AC code, surprisingly though, the MLE code consumes about 1GB memory whereas the AC one only consumes 260MB.
It's been bugging me a lot, why would this happen — can anyone please help?
Thanks in advance.