Answers for "ranged query kth character in list of strings"

0

ranged query kth character in list of strings

for(int i=0;i<words.size();i++){
        for(char ch : words[i]){
            mat[i][ch-'a']++;
        }
    }
Posted by: Guest on August-03-2021
0

ranged query kth character in list of strings

char determine_character(vector<string> words, int l, int r, int k){    
    int sum=0;
    for(int i=0;i<26;i++){
         for(int j= l-1;j<=r-1;j++)
            sum += mat[j][i];
        
         if(sum>=k)
            return 'a' + i;    
    }
    return 'z';
}
Posted by: Guest on August-03-2021

Code answers related to "ranged query kth character in list of strings"

Browse Popular Code Answers by Language