Leetcode - Reverse String

My code:

public class Solution {
    public String reverseString(String s) {
        if (s == null || s.length() == 0) {
            return s;
        }
        
        StringBuilder sb = new StringBuilder(s);
        return sb.reverse().toString();
    }
}

煞笔题目,没什么好说的。

Anyway, Good luck, Richardo! — 08/27/2016

    原文作者:Richardo92
    原文地址: https://www.jianshu.com/p/197b0e828838#comments
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞