Skip to content

Commit a08745f

Browse files
authoredMay 26, 2022
update code 2
1 parent c4f50bd commit a08745f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Dynamic Programming/37) Longest Increasing Subsequence (Binary Search).md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class Solution {
5151
int index;
5252
if(curr>arr[maxLength-1]) {
5353
index = maxLength;
54+
maxLength++;
5455
} else {
5556
index = binarySearch(arr, 0, maxLength, curr);
5657
}
57-
if(index==maxLength) maxLength++;
5858
arr[index] = curr;
5959
}
6060
return maxLength;

0 commit comments

Comments
 (0)
Please sign in to comment.