Apr-08-2021, 09:47 PM
(Apr-08-2021, 09:17 PM)SantiagoPB Wrote: I am trying to give the length of the list using n variable
I guess what I mean is, "Why did you think this would work?" Writing the recursive function requires some thought, and you accomplished that, so I'm trying to understand what the logic was behind your approach. What if you start by just assuming that the integer input will be 1 and the string will be 3 characters long, and figure out how you'd code that solution?
(Disclaimer: I haven't tried to code a solution and don't have a specific approach in mind.)