Getting correct answer but not getting submitted

While submitting it’s showing wrong answer & that xyz should be the correct output. But when I ran the same input as custom input it’s showing xyz only as the output. So like my code is giving correct output for the test cases but not getting submitted. I have used recursion in an another function and I am calling that function from the given function. Could that be the reason of not getting submitted?

Click here to start solving coding interview questions