Concept Flow - Longest Increasing Subsequence
Start with array
Initialize LIS array with 1s
For each element i
Check all elements j < i
If arr[j
Update LIS[i
Repeat for all i
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 checking previous elements smaller than current. Finally, we find the maximum LIS length.