Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- string str;
- int k;
- while(cin>>k>>str){
- bool state = islower(str[0]); // is lower is the base of variable
- int maxLen = 0;
- int len=0;
- for(int i=0;str.size();i++){
- if(i>0 && i%k==0){//change char state
- }
- if(islower(str[i]) == state){ //case condition
- len++;
- }
- else{
- len = 0;
- state = islower(str[i+1]);
- if(len > maxLen)
- maxLen = len;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment