Skip to content

Instantly share code, notes, and snippets.

@chaoxu
Last active November 27, 2023 01:42
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaoxu/d9e5a40b0c17d63237e3701e9228b602 to your computer and use it in GitHub Desktop.
Save chaoxu/d9e5a40b0c17d63237e3701e9228b602 to your computer and use it in GitHub Desktop.
Interesting leetcode problems

This is an index of leetcode problems that I find interesting.

You can see many theoretical solutions by hqztrue here.

TCS Problems

Likely only people who work in the area knows the current best solution. The best solution is either in some paper, or requires advanced tricks.

  • 001 2SUM
  • 004 Median of Two Sorted Arrays
  • 010 Regular expression matching
  • 015 3SUM
  • 016 3Sum Closest
  • 018 4Sum
  • 023 Merge k Sorted Lists
  • 132 Palindrome Partitioning II
  • 139 Word Break
  • 170 Two Sum III - Data structure design
  • 188 Best Time to Buy and Sell Stock IV
  • 220 Contains Duplicate III
  • 315 Count of Smaller Numbers After Self
  • 477 Total Hamming Distance
  • 486 Predict the Winner
  • 750 Number Of Corner Rectangles
  • 1157 Online Majority Element In Subarray

Tricky Problems

One can discover very good solution by themselves and have an aha moment. Some problems reduces to problems above.

  • 041 First Missing Positive
  • 042 Trapping Rain Water
  • 044 Wildcard Matching
  • 084 Largest Rectangle in Histogram
  • 085 Maximal Rectangle
  • 164 Maximum Gap
  • 211 Add and Search Word - Data structure design
  • 218 The Skyline Problem
  • 229 Majority Element II
  • 240 Search a 2D Matrix II
  • 279 Perfect Squares
  • 322 Coin Change
  • 378 Kth Smallest Element in a Sorted Matrix
  • 406 Queue Reconstruction by Height
  • 410 Split Array Largest Sum
  • 494 Target Sum
  • 644 Maximum Average Subarray II
  • 741 Cherry Pickup

Fun problems

You can solve these problems with basic algorithms knowledge, and you obtain some useful insights.

  • 127 Word Ladder
  • 137 Single Number II
  • 162 Find peak element
  • 215 kth largest element in an array
  • 264 Ugly Number II
  • 300 Longest Increasing Subsequence
  • 462 Minimum Moves to Equal Array Elements II
  • 502 IPO
  • 524 Longest Word in Dictionary through Deleting
  • 652 Find Duplicate Subtrees
  • 676 Implement Magic Dictionary
  • 678 Valid Parenthesis String
  • 739 Daily Temperatures
  • 962 Maximum Width Ramp
  • 719 Find K-th Smallest Pair Distance
  • 765 Couples Holding Hands
  • 774 Minimize Max Distance to Gas Station

Unknown

I saw these problems and didn't think a lot about them, they might be interesting.

  • 813 Largest Sum of Averages
  • 472 Concatenated Words
  • 664 Strange Printer
  • 871 Minimum Number of Refueling Stops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment