I know there is a space in the former one. And the former one is my output. I want to know why there is a space in it?
The most likely cause is that you aren't actually returning it when it gathers your output. If you have a print statement in your code, the judge will take that result instead of what is returned and use that to compare with the expected value. While the printed version of an array and the array look the same when printed, one is a string and the other is an array in comparison, so you get "Wrong answer".
Search your code for print statements and remove them, and you should pass this test case.