The question clearly mentions no leading or trailing spaces but the test case contains a leading space which gives an error for the submission.
I am also facing same issue. did you find any solution ?
condition 1. >> remove extra space (use trim() in java)
condition 2. >> do not add space after the last element or (once you completed the reversing string then trim() again)