Untitled

 avatar
unknown
plain_text
a month ago
447 B
22
Indexable
class Solution {
public:
    vector<int> scoreValidator(vector<string>& events) {
        vector<int> ans;
        int sc =0,cnt=0;
        for(auto it : events){
            if(it[0] >= '0' && it[0] <= '6'){
                sc += it[0] - '0';
            }
            else if(it.size() == 1){
                cnt++;
            }
            else sc++;
            if(cnt == 10)break;
        }
        return {sc,cnt};
    }
};
Editor is loading...
Leave a Comment