Is my solution cheating?

  • 0
    int lengthOfLastWord(const char *s) {
    stringstream ss(s);
    string word;
    while(ss >> word);
    return word.size();}

    Is this a proper solution to give during an interview? Am I cheating?

Log in to reply

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