The question is asking for an integer to be taken and the zero to be replaced by 5 I have written a working code for it following the constraint yet somehow one of the test case is failing.
My correct code is not passing one of the test case
add one condition in replace( )
function :
if(n==0) return 5;
Modified Code is:
Oh yes, silly mistake, thank you!
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.