## lc960. Delete Columns to Make Sorted III

https://leetcode.com/problems/delete-columns-to-make-sorted-iii/ 1. Naive way O(n^2) to calculate longest subsequence dp[i] is the longest subsequence ending with i position. if charAt(j) <= charAt(i), then dp[i] = max(dp[i], dp[j] + 1) 2. Only cares about column i, column j, where all chartAt(j) <= charAt(i), then we update dp[i] public static int minDeletionSize(String[] A) { int[] dp =… Read More »