Leetcode DP(Dynamic Programming)

Summer.K
3 min readNov 25, 2020

One-dimensional DP:

  • Clear thinking is the most important because each question varies greatly.
  1. Longest Valid Parentheses. Find the length of the longest valid substring of a string that contains only “(“ and “)”. Valid means that all the parentheses in the substring match correctly.
  2. Maximum Subarray. What is the maximum value of a one-dimensional array (A[0], A[1],…,A[n-1], A[n]) of n integer elements with many consecutive subarrays, where the sum of the arrays is the maximum value?

--

--

Summer.K
0 Followers

Graduate student looking for data full-time job.