I did not understand how to write code

so i have understood how the function works bit i dont know hoe to take input can u pls share the solution as i was unable to taKe input

Here’s the code for the problem you have asked for

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.