• Don't assume there will always be a single space between words.

  • The most common mistake people make with this kata is assuming that there will only be one space character between words

  • The usual reason people fail this kata is because they assume there will only ever be one space between words.

  • Enjoyable, but more challenging than I expected for a 7kyu. I'm sure there must be a cleaner solution than mine, but it was a satisfying kata nevertheless!

  • There are two spaces between each word - make sure both spaces are retained in your return value.

  • be careful npot to accidentally add a space at the end of your string e.g. ".god " instead of ".god"

  • Check the spaces in the string you are returning. You may find that you have an additional space character...

  • Looks like you might have an extra space after the last word in your answers? e.g. "elppa " instead of "elppa"

  • The original string has double spaces between words and they need to be preserved in your answer.

  • There is a test case with double spaced words which trips up a lot of solutions. e.g. 'double spaced words' should become 'elbuod decaps sdrow' (It is hard to tell when reading this comment, but there are two spaces separating each word).

  • @Elostier Works in the JS version. I haven't tried the Python translation.

  • This comment is hidden because it contains spoiler information about the solution

  • In that case try dropping the trailing white space. You are adding a space after each word, including the last word in the source sentence.

    EDIT: Removed the snark. Sorry to have been crabby.

  • You have to reverse the words in place, not reverse the entire sentence.


    "Hello there" = "olleH ereht" NOT "ereht olleH"

  • This comment is hidden because it contains spoiler information about the solution

  • Loading more items...