fix: p97 subtract panic.
This commit is contained in:
parent
a29a200972
commit
67d1277152
|
@ -20,6 +20,10 @@ impl Solution {
|
||||||
|
|
||||||
for i in 0..=n {
|
for i in 0..=n {
|
||||||
for j in 0..=m {
|
for j in 0..=m {
|
||||||
|
if i == 0 && j == 0 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let p = i + j - 1;
|
let p = i + j - 1;
|
||||||
|
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -44,5 +48,6 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_97() {
|
fn test_97() {
|
||||||
|
assert!(Solution::is_interleave("aabcc".to_owned(), "dbbca".to_owned(), "aadbbcbcac".to_owned()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user