It's required to trim the result to avoid emtpy spaces in the beginning and the end of the resulting sentence - it is one of the requirements. I've added a test case method to check that for array [" ", "a", "b", " "] there is a result "a b", and not " a b ", but somehow my solution is marked as the one not passing anymore (was passing but the kata has changed).
The code is misaligned and "for" doesn't have braces. Yes, from first look the solution doesn't seem to be valid.
It's required to trim the result to avoid emtpy spaces in the beginning and the end of the resulting sentence - it is one of the requirements. I've added a test case method to check that for array [" ", "a", "b", " "] there is a result "a b", and not " a b ", but somehow my solution is marked as the one not passing anymore (was passing but the kata has changed).