This commit is contained in:
Barrett Ruth 2026-03-06 20:22:19 -05:00
parent 516d1b02b7
commit 0329c802a6
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 15 additions and 1 deletions

10
1621.rs Normal file
View file

@ -0,0 +1,10 @@
use std::io::{self,Read};
fn main(){
let mut s=String::new();
io::stdin().read_to_string(&mut s).unwrap();
let s=s.trim().as_bytes();
let(mut mx,mut c)=(1usize,1usize);
for i in 1..s.len(){if s[i]==s[i-1]{c+=1;}else{c=1;}if c>mx{mx=c;}}
println!("{}",mx);
}