Skip to content

Commit 6201ef8

Browse files
committed
Runtime: 3 ms (Top 93.99%) | Memory: 10 MB (Top 62.81%)
1 parent 551cf44 commit 6201ef8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// Runtime: 3 ms (Top 93.99%) | Memory: 10 MB (Top 62.81%)
12
class Solution {
23
public:
34
bool canBeIncreasing(vector<int>& nums) {
45
int count = 0;
56
for (int i = 1; i < nums.size(); ++i) {
67
if (nums[i] <= nums[i - 1]) {
7-
if (count == 1)
8+
if (count == 1)
89
return false;
910
count++;
1011
if (i > 1 && nums[i] <= nums[i - 2] )
1112
nums[i] = nums[i - 1];
1213
}
1314
}
14-
return true;
15+
return true;
1516
}
16-
};
17+
};

0 commit comments

Comments
 (0)