Wave print problem

my sample input code for wave print is running successfully on my ide but when I submit the code, none of the test cases is successful.