Skip to content

Commit 4df50d8

Browse files
committed
Update additive-number.cpp
1 parent 9b7f897 commit 4df50d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/additive-number.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class Solution {
55
public:
66
bool isAdditiveNumber(string num) {
7-
for (int i = 1; i < num.length() - 1; ++i) {
7+
for (int i = 1; i < num.length(); ++i) {
88
for (int j = i + 1; j < num.length(); ++j) {
99
string s1 = num.substr(0, i), s2 = num.substr(i, j - i);
1010
if ((s1.length() > 1 && s1[0] == '0') ||

0 commit comments

Comments
 (0)