'looks like you've solved it'
This comment is hidden because it contains spoiler information about the solution
Not a kata issue, but problem with your code. Look at expected result and your result - there is a trailing whitespace at the end in your result.
Please read this FAQ before posting issues.
Hi everyone, I get this error expected:<...j revo eht yzal .god> but was:<...j revo eht yzal .god[ ]> since I have tested the code should be good in my IDE but when I apply the code in here cause this error return.
The usual reason people fail this kata is because they assume there will only ever be one space between words.
I found that it's blocked or otherwise not functioning in FireFox. Works fine in Safari and, I would imagine it works in Chrome.
Please if this explains anything: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#how-can-i-see-which-input-causes-my-solution-to-fail
Output of printing is visible in test output panel.
Yeah that's more or less what I was doing, but where in CodeWars can I see the output of println() or are you using an IDE?
public class Kata
public static String reverseWords(final String original)
That worked just fine for me.
thank you so much, i see now,
thanks to your help now I can try finish the second part of the kata
thank you orz
Yes, '\0' is a null terminator, but it's not the on which causes your trouble. This line: new[k] = text[sub]; (probably unintentionally) adds a null terminator in the very beginning of your string (at new), effectively causing it to always have length of 0.
new[k] = text[sub];
Again, do not guess and change your program randomly. It will be easier to step through your solution in debugger, locally, in your IDE, and see what exactly happens.