i wrote code for this and its working fine but i want to know if there can be some optimisations
if there are any optimisation plz explain them
my code: https://ide.codingblocks.com/s/85740
i wrote code for this and its working fine but i want to know if there can be some optimisations
if there are any optimisation plz explain them
my code: https://ide.codingblocks.com/s/85740
this is correct.
optimization to recursion can be done by memoization and dynamic programming (top down or bottom up approach)
whats memorization and dp ?
we will learn that in further course …then we can do that
bcz dp is not taught yet
yes it will be taught in the coming content of the course
wait for it after learning dp you will be able to do that