OUTPUT SAYS MLE

can you tell me why the code is giving MLE. Also what is MLE?

hello @akshatsaraswat03
MLE stands for memory limit exceeded. this error occurs when ur program uses more than the allowed memory.

to solve this ->
declare ur dp array of size 5000 X 5000, and do memoisation upto this size only.
pls refer this code ->

so does an 2D array above 5000 X 5000 exceeds the allowed memory in most cases ?

10000 X 10000 at max but then the datatype should be boolean.