We have an array of integer numbers. We want to know for each element whether that element is contained at least in one LIS of many LISs of our array or not. We want to know this for all elements in the array in less than O(n2).
For example array [2, 4, 3, 2, 5] has two LISs. All elements in the array belong to at least one of these LISs, exept the 4th element which does not belong to any LIS.
I know an easy solution which uses dfs, but its runtime is O(n2).