Coding · Medium · Pro
Length of longest increasing subsequence
CodingDynamic ProgrammingSenior
Approach
- Patience sorting / tails array: for each num, binary search position to replace.
- Length of tails is LIS length.
Java Solution
Java
public int lengthOfLIS(int[] nums) {
int[] tai…