This question was asked was in an OA. I was not able to sovle it fully i.e my soln got partially accepted.
Question
Code
Constraints
I want to solve this problem via memorization as I am not so good at writing bottom-up approach directly.
I took 5 states-> X and Y coordinates of alice and bob and index of the corr(array of position of apples). How to optimize states?
Thanks in advance.