juanr.co

Home

❯

Tech

❯

DSA notes

❯

Two Pointer

Two Pointer

Dec 05, 20251 min read

  • tech
  • 167. Two Sum II - Input Array Is Sorted
  • 26. Remove Duplicates from Sorted Array
  • 83. Remove Duplicates from Sorted List
  • 977. Squares of a Sorted Array
  • 15. 3Sum
  • 16. 3Sum Closest
  • 3Sum Smaller (lc premium)
  • 75. Sort Colors (also Dutch National Flag?)
  • 18. 4Sum
  • 844. Backspace String Compare This can be done with stacks (but that means extra memory) or with two pointers for no extra space
  • 581. Shortest Unsorted Continuous Subarray
    • From both ends, find where order is “broken”, then find the min and max values between those stops. Then, if there is a bigger than min element to the left, add the element to the left; and if there is a smaller element than max to the right, add it.

Graph View

Backlinks

  • DSA notes

Created with Quartz v4.5.0 © 2025

  • GitHub