one line python and c++


  • 0
    Z
    class Solution(object):
        def checkRecord(self, s):
            """
            :type s: str
            :rtype: bool
            """
            return s.count('A') < 2 and s.find("LLL") == -1
    
    class Solution {
    public:
        bool checkRecord(string s) {
            return count(s.begin(), s.end(), 'A') < 2 && s.find("LLL") == string::npos;
        }
    };
    

Log in to reply
 

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