Solve a non-standard variant of LIS
via2dbi
Problem
A non-standard variant of Longest Increasing Subsequence (LIS).
Approach
- Start from the classic O(n log n) patience-sorting / binary-search LIS
- Adapt the DP recurrence to the variant's twist (e.g., constraints on adjacency, differences, or grouping)
- Discuss the DP state and how the variation changes the transitions
Note
The exact twist is non-standard — clarify the variant's rules with the interviewer before coding.
asked …