Skip to content

Commit 9cfba58

Browse files
authored
Update 306. Additive Number.cpp
1 parent 422b908 commit 9cfba58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LeetCode/306. Additive Number.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ class Solution {
44
return false;
55
}
66

7-
if(idx == num.length() && prev1 != -1 && prev2 != -1 && cnt > 2) {
7+
if(idx == num.length() && cnt > 2) {
88
return true;
9-
} else if (idx == num.length() && (prev1 == -1 || prev2 == -1 || cnt <= 2)) {
9+
} else if (idx == num.length() && cnt <= 2) {
1010
return false;
1111
}
1212

0 commit comments

Comments
 (0)