Pattern DoubleSidedArrow

I am not able to clear the Test Case 6 and 7 . I am not able where is my code lagging.

@rahul.aggarwal000005 for the input
1
the output should be 1
but your output is 1 1

But there are two test cases i m lagging

hi @rahul.aggarwal000005 try to fix this one (without using a simple if else condition) and you will probably fix both the cases. If you are stuck let me know.