Pattern - DoubleSidedArrow

Though all the test cases are passed, but I’m not getting the exact output as given in hidden test cases.
my code link: https://ide.codingblocks.com/s/427902
what modification do I need to do in the code?