diff options
Diffstat (limited to 'packages/cses/problems/1069.cpp')
| -rw-r--r-- | packages/cses/problems/1069.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/cses/problems/1069.cpp b/packages/cses/problems/1069.cpp new file mode 100644 index 0000000..232d2f7 --- /dev/null +++ b/packages/cses/problems/1069.cpp @@ -0,0 +1,23 @@ +#include <iostream> + +int main() { + std::string input; + std::cin >> input; + + auto max = 0; + auto curr = '-'; + auto count = 0; + + for (auto const ch : input) { + if (curr != ch) { + curr = ch; + count = 0; + } + + count += 1; + max = std::max(max, count); + } + + std::cout << max; + return 0; +} |
