done 3 sorting problems

This commit is contained in:
2024-06-03 16:57:59 +02:00
parent cf617f6dfa
commit c817cf7f3c
23 changed files with 85 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
// Repetitions
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int max_count = 0;
int current_count = 0;
char current = ' ';
for (auto c : s) {
if (c == current) {
current_count ++;
max_count = max(max_count, current_count);
} else {
current = c;
current_count = 1;
max_count = max(max_count, current_count);
}
}
cout << max_count << endl;
return 0;
}