Simple C++ Solution


  • 0
    A

    class Solution {
    public:
    string reverseString(string s) {
    string res;
    int len = s.length(), i;
    for(i = len - 1; i >= 0; i--){
    res += s[i];
    }
    return res;
    }
    };


Log in to reply
 

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