You want total rupees at age 55, starting with AMOUNT at age AGE.
What's wrong with the chatgpt code?
Edit: and what do you mean by finding the solution "dynamically"? I see nothing static about the chatgpt solution. (Perhaps you mean that the age limit 55 is to be made into a paramenter).
... View more