Why is my output correct but the solution is not accepted ?