Exchanging coins-----

i didnt get this problem what it is trying to explain and also unable to analyse it means i don’t understand what it makes me learn … i saw hint video coded it and submitted solution…
plz explain solution with its significance
link-:

hi, great to know that u are curious as to what the question is trying to teach you,
so
this question is basically teaching u how to use recurrence relation using top-down dp.
memoisation is being done.
also question makes u think of how to set the base condition
small concepts help u gain better understanding of bigger concept so this is amongst those smaller one`s.

but i was talking about logical concept ???
the things you mentioned i am aware of that.

question is asking u tell:
what is the maximum weight of gold that we can have at any given step.

so in order to maintain the state at any stage
we are doing a max operation for anypreviousWeightOfGold, presently calculated weight

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.