@@ 16,13 16,14 @@ fn main() {
e2 = (e2 + st[e2] as usize + 1) % st.len();
}
print!(" 1: ");
- for i in &st[input..input+10] {
+ for i in &st[input..input + 10] {
print!("{}", i);
}
println!();
// reset for p2
st.clear();
- st.push(3); st.push(7);
+ st.push(3);
+ st.push(7);
let mut e1 = 0;
let mut e2 = 1;
let mut p = 0;
@@ 36,7 37,7 @@ fn main() {
e2 = (e2 + st[e2] as usize + 1) % st.len();
while p + inarr.len() < st.len() {
//println!("{:15}: {:?}", p, &st[p..p+INARR.len()]);
- if inarr == &st[p..p+inarr.len()] {
+ if inarr == &st[p..p + inarr.len()] {
break 'out p;
}
p += 1;