Concept Flow - Longest Increasing Subsequence
Start with array
Initialize LIS array with 1s
For each element i from 1 to n-1
For each element j from 0 to i-1
Check if arr[i
Update LIS[i
Repeat inner loop
Repeat outer loop
Find max value in LIS array
Return max LIS length
We start with the array and build an LIS array where each position stores the length of the longest increasing subsequence ending there. We update LIS values by comparing current elements with previous ones. Finally, we find the maximum LIS length.
