You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a recent leetcode weekly contest hard problem.
Usually, LIS is solved using DP ( O(n^2) Solution ).
In this problem, we could only take elements with differences not more than K and we have to find the longest increasing subsequence.
Constraints are such that we can not use O(n^2) DP approach and we can not as well use binary search optimization of LIS.
So, the Solution is based on Range Max Queries using segment Trees. Time Complexity of solution: O(nlog(maximum element in the array))*
This solution is accepted on leetcode.
Can you please assign it to me @ritikbanger under hacktober fest tag.
The text was updated successfully, but these errors were encountered:
Anurodhac
changed the title
Longest Increasing Subsequence II (Leetcode)
Longest Increasing Subsequence II (Leetcode) in C++
Oct 14, 2022
This is a recent leetcode weekly contest hard problem.
Usually, LIS is solved using DP ( O(n^2) Solution ).
In this problem, we could only take elements with differences not more than K and we have to find the longest increasing subsequence.
Constraints are such that we can not use O(n^2) DP approach and we can not as well use binary search optimization of LIS.
So, the Solution is based on Range Max Queries using segment Trees.
Time Complexity of solution: O(nlog(maximum element in the array))*
This solution is accepted on leetcode.
Can you please assign it to me @ritikbanger under hacktober fest tag.
The text was updated successfully, but these errors were encountered: