My cheating solution.


  • 2
    R

    public:

    int myAtoi(string str) {
    
        if ( str == "" ) return 0;
    
        stringstream stream(str);  
    
        int rtn; 
    
        stream >> rtn;
    
        return rtn;
    
    }
    

    };


Log in to reply
 

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