Complexity doubt

in the optimal game strategy question,how to visualise its time complexity in the top down approach?
and
what is the space needed for call stack in this question.is it O(n2) or O(n)?

@Rj.25 it would take 0( n^2) time and space

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.