One-liner c++


  • 0
    M
            vector<string> findWords(vector<string>& words) {
                return {
                    begin(words),
                    partition(begin(words), end(words), [](const string& word)
                    {
                        return
                            (word.find_first_not_of("qwertyuiop""QWERTYUIOP", 0) == -1) ||
                            (word.find_first_not_of("asdfghjkl""ASDFGHJKL", 0) == -1) ||
                            (word.find_first_not_of("azxcvbnm""AZXCVBNM", 0) == -1);
                    }) };
            }
    

Log in to reply
 

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