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…

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.

Notice that the solution set must not contain duplicate triplets.

Example 1:

Leetcode Algorithm 11. Container With Most Water

Leetcode Algorithm Problem 8. String to Integer (atoi)

Leeetcode Problem 7. Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.

Note:
Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. …

Summer.K

Graduate student looking for data full-time job.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store