Codeforces Round #429 (Div. 2), problem: (A) Generous Kefa Solution in C/C++

#include<iostream>
using namespace std;
int i,j,n,k,a[26];
string s;
main(){
for(cin>>n>>k>>s;i<s.size();)a[s[i++]-‘a’]++;
for(i=0;j<26;)a[j++]>k?i=1:0;
cout<<(i?”NO\n”:”YES\n”);
}

(Visited 167 times, 1 visits today)

About the Author:

Leave A Comment