I've try several way to submit my solution,but it always show time exceed.I don't known why,can you help me?

  • 0

    public String reverseString(String str) {
    String result = "";
    int temp = str.length() - 1;
    while(temp >= 0)
    result += str.charAt(temp--);
    return result;

Log in to reply

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