Was solving Matrix chain multiplication on GFG using memoization and got this weird error.
Code works fine when I use a 2D array to store the states, But Gives TLE when vectors are used. Is there any specific reason for this?
Accepted submission: https://pastebin.com/3ZdC61Vc
TLE submission: https://pastebin.com/VbdFrzDJ