Ad

Pretty much all this is is that you reverse the letters of a String, like it says in the title. Good luck! (I literally just said "is" twice...) I don't know why it doesn't work. Maybe their is a problem with the test cases. Please help!

public class ReverseString {
  public static String reverseString(String word) {
    String reversedWord = "";
    
    for (int i = 0; i < word.length(); i++) {
      reversedWord = word.charAt(i) + reversedWord;
    }
    
    return reversedWord;
  }
}