Comment by integralid

Comment by integralid 3 days ago

3 replies

If someone doesn't know how to reverse words in a sentence they are absolutely not qualified to be a programmer. Yes they probably won't do this exact task often, but this is like a doctor that can't distinguish heart from the liver. It tells you something has gone horribly wrong.

ThunderSizzle 3 days ago

In many languages, the basic version can be just one line of code, if you know the right libraries to leverage. C# leveraging Linq, for example:

    String.Join(" ",
      String.Split(" ", sentence).Reverse()))
chongli 3 days ago

What if the sentence is in Japanese (which doesn’t use spaces)?