fix: p97 subtract panic.

This commit is contained in:
jackfiled 2024-08-11 11:20:41 +08:00
parent a29a200972
commit 67d1277152

View File

@ -20,6 +20,10 @@ impl Solution {
for i in 0..=n {
for j in 0..=m {
if i == 0 && j == 0 {
continue;
}
let p = i + j - 1;
if i != 0 {
@ -44,5 +48,6 @@ mod tests {
#[test]
fn test_97() {
assert!(Solution::is_interleave("aabcc".to_owned(), "dbbca".to_owned(), "aadbbcbcac".to_owned()));
}
}