it is just this simple ???
or i understood something wrong in this ???
coz not passing test cases
it is just this simple ???
or i understood something wrong in this ???
coz not passing test cases
hello @hg11110000
it is simple but not this much.
yeah u understood bit wrong.
here we can break coins (n/2,n/3,n/4) furthur to get max from them.
ur recurrence relation should be
solve(n)=>max( n, solve(n/2)+solve(n/3) +solve(n/4) )
yeah use map to memoise becuase value of n can be upto 10^9 ,and we cannot make array of that big size