simple JAVA solution


  • 0
    1

    写一个函数,输入一个字符串,返回它的翻转

    Example:
    Given s = "hello", return "olleh".

    class Solution {
        public String reverseString(String s) {
            StringBuilder my=new StringBuilder(s);
            return my.reverse().toString();
        }
    }
    

Log in to reply
 

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