`minend[i]`

is the minimum ending of an increasing subsequence of length `i+1`

.

```
def lengthOfLIS(self, nums):
minend = [float('inf')] * (len(nums) + 1)
for num in nums:
minend[bisect.bisect_left(minend, num)] = num
return minend.index(float('inf'))
```