I have wrote. a solution of this problem and in one of the Test case it is showing memory Limit excedded. Can u help figure out why it is showing memory limit excedded.
I understand the another approach showing the solution but still I wanted to understand why my solution won’t work
https://ide.codingblocks.com/s/334514.
Please help here