Given an array, please check if we can remove at most one element to make it strictly increasing.
Example 1:
Input: [1, 2, 3, 7, 5, 6]
Output: trueExample 2:
Input: [1, 2, 3, 7, 8, 4, 5]
Output: falseFollow-up 1:
What if at most 2?
Follow-up 2:
what if at most k?
firstly see K = 1, I focus too much on remove element, but it's just a longest increasing sequence problem.
reference : https://www.geeksforgeeks.org/convert-to-strictly-increasing-integer-array-with-minimum-changes/
return (arr.size() - longest_increasing_element_cnt) >= K;But I realize til now...