Leetcode 300. Longest Increasing Subsequence

Daniel Mesizah
5 min readJul 14, 2021

QUESTION:

SOLUTION:

def binarySearch(self, subsequence, val):
left = 0
right = len(subsequence)-1
while left <= right:
# do this to avoid overflow
mid = left + (right - left)//2
# if mid element of subsequence is less than val
# set left to middle + 1
if…

--

--

Daniel Mesizah

Coder who likes to share what he knows with the rest of the world