Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtkana committed Mar 16, 2024
1 parent 2792ca2 commit 0c98a3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/manacher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ mod tests {
for _ in 0..200 {
let n = rng.gen_range(0..10);
let s = (0..n).map(|_| rng.gen_range(0..4)).collect::<Vec<_>>();
let a = manacher(&s);
for i in 0..=2 * n {
let result = manacher(&s);
for (i, &result) in result.iter().enumerate() {
let mut l = i / 2;
let mut r = i - l;
while 0 < l && r < n && s[l - 1] == s[r] {
l -= 1;
r += 1;
}
assert_eq!(a[i], r - l);
assert_eq!(result, r - l);
}
}
}
Expand Down

0 comments on commit 0c98a3b

Please sign in to comment.