Java Solution


  • 0
    S
    public String reverseString(String s) {
            StringBuilder sb = new StringBuilder();
            for (int i = s.length() - 1;i >= 0;i--) {
                sb.append(s.charAt(i));
            }
            return sb.toString();
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.