Memory Limit Exceeded


  • 0
    J
    public:
        string reverseString(string str) {
            if(str=="")return ""; 
            char curr=str[0];
            string tmp=reverseString(str.substr(1));
            return tmp+curr;
        }
    };~~~~
    
    Why do I get MLE for this code ?

Log in to reply
 

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