Untitled
unknown
plain_text
2 months ago
447 B
23
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