cswork / listsOpen the problem bank

Mapped by number

Coding Interviews (剑指 Offer, 2nd ed.), mapped

Coding Interviews (剑指 Offer, 2nd ed.)'s 75 problems mapped by number to CSWork: 71 can be judged online here, the rest link out to LeetCode. Not an official list.

71 / 75 judgeable here4 external43 of 75 have a LeetCode twin
Practice this list in the bank →

Chapter 2 · Fundamentals (3–15)14 problems · 14 judgeable here

  1. Offer 03Find Every Reused LabelOriginal: Find Every Reused Label (opens in a new tab)JudgeableEasy
  2. Offer 04Search a 2D Matrix IILeetCode 24006 Binary SearchJudgeableMedium
  3. Offer 05Encode Spaces as %20Original: Encode Spaces as %20 (opens in a new tab)JudgeableEasy
  4. Offer 06Read a Linked List BackwardsOriginal: Read a Linked List Backwards (opens in a new tab)JudgeableEasy
  5. Offer 07Construct Binary Tree from Preorder and Inorder TraversalLeetCode 10512 Tree BuildingJudgeableMedium
  6. Offer 09A Queue Out of Two StacksOriginal: A Queue Out of Two Stacks (opens in a new tab)JudgeableEasy
  7. Offer 10-IFibonacci Modulo a PrimeOriginal: Fibonacci Modulo a Prime (opens in a new tab)JudgeableEasy
  8. Offer 10-IIClimbing StairsLeetCode 7022 DP BasicsJudgeableEasy
  9. Offer 11Find Minimum in Rotated Sorted Array IILeetCode 15406 Binary SearchJudgeableHard
  10. Offer 12Word SearchLeetCode 7921 PruningJudgeableMedium
  11. Offer 13How Far the Robot Vacuum GoesOriginal: How Far the Robot Vacuum Goes (opens in a new tab)JudgeableMedium
  12. Offer 14-IInteger BreakLeetCode 34322 DP BasicsJudgeableMedium
  13. Offer 14-IIInteger BreakLeetCode 34322 DP BasicsJudgeableMedium
  14. Offer 15Number of 1 BitsLeetCode 19135 Bits & MathJudgeableEasy

Chapter 3 · Complete, robust code (16–26)10 problems · 8 judgeable here

  1. Offer 16LeetCode 50 (opens in a new tab)LeetCode 50External
  2. Offer 17List Every Positive Number of at Most n DigitsOriginal: List Every Positive Number of at Most n Digits (opens in a new tab)JudgeableEasy
  3. Offer 18Unlink One NodeOriginal: Unlink One Node (opens in a new tab)JudgeableEasy
  4. Offer 19Regular Expression Matching (opens in a new tab)LeetCode 10ExternalHard
  5. Offer 20Is This String a Number?Original: Is This String a Number? (opens in a new tab)JudgeableMedium
  6. Offer 21Odd Numbers FirstOriginal: Odd Numbers First (opens in a new tab)JudgeableEasy
  7. Offer 22The Last k Nodes of a ListOriginal: The Last k Nodes of a List (opens in a new tab)JudgeableEasy
  8. Offer 24Reverse Linked ListLeetCode 20609 Linked ListsJudgeableEasy
  9. Offer 25Merge Two Sorted ListsLeetCode 2109 Linked ListsJudgeableEasy
  10. Offer 26Does One Tree Fit Inside Another?Original: Does One Tree Fit Inside Another? (opens in a new tab)JudgeableMedium

Chapter 4 · Draw, give examples, decompose (27–38)14 problems · 13 judgeable here

  1. Offer 27Invert Binary TreeLeetCode 22610 Tree TraversalJudgeableEasy
  2. Offer 28Symmetric TreeLeetCode 10110 Tree TraversalJudgeableEasy
  3. Offer 29LeetCode 54 (opens in a new tab)LeetCode 54External
  4. Offer 30Min StackLeetCode 15532 IteratorsJudgeableMedium
  5. Offer 31Validate Stack SequencesLeetCode 94607 Stacks & HeapsJudgeableMedium
  6. Offer 32-IWalk a Binary Tree Level by LevelOriginal: Walk a Binary Tree Level by Level (opens in a new tab)JudgeableMedium
  7. Offer 32-IIBinary Tree Level Order TraversalLeetCode 10210 Tree TraversalJudgeableMedium
  8. Offer 32-IIIBinary Tree Zigzag Level Order TraversalLeetCode 10310 Tree TraversalJudgeableMedium
  9. Offer 33Check a Search Tree's Postorder SequenceOriginal: Check a Search Tree's Postorder Sequence (opens in a new tab)JudgeableMedium
  10. Offer 34Path Sum IILeetCode 11311 Tree PathsJudgeableMedium
  11. Offer 35Copy List with Random PointerLeetCode 13809 Linked ListsJudgeableMedium
  12. Offer 36Convert Binary Search Tree to Sorted Doubly Linked List 🔒LeetCode 42613 BSTJudgeableMedium
  13. Offer 37Serialize and Deserialize Binary TreeLeetCode 29734 Trie & CodecJudgeableHard
  14. Offer 38Every Arrangement of a StringOriginal: Every Arrangement of a String (opens in a new tab)JudgeableMedium

Chapter 5 · Time and space efficiency (39–52)14 problems · 13 judgeable here

  1. Offer 39Majority ElementLeetCode 16901 In-place ArraysJudgeableEasy
  2. Offer 40The k Smallest NumbersOriginal: The k Smallest Numbers (opens in a new tab)JudgeableEasy
  3. Offer 41Find Median from Data StreamLeetCode 29533 CachesJudgeableHard
  4. Offer 42Maximum SubarrayLeetCode 5301 In-place ArraysJudgeableMedium
  5. Offer 43Number of Digit OneLeetCode 233JudgeableHard
  6. Offer 44LeetCode 400 (opens in a new tab)LeetCode 400External
  7. Offer 45Build the Smallest NumberOriginal: Build the Smallest Number (opens in a new tab)JudgeableMedium
  8. Offer 46Ways to Read Digits as LettersOriginal: Ways to Read Digits as Letters (opens in a new tab)JudgeableMedium
  9. Offer 47Most Coins on the Way DownOriginal: Most Coins on the Way Down (opens in a new tab)JudgeableMedium
  10. Offer 48Longest Substring Without Repeating CharactersLeetCode 304 Two PointersJudgeableMedium
  11. Offer 49Ugly Number IILeetCode 264JudgeableMedium
  12. Offer 50The First Letter That Appears OnceOriginal: The First Letter That Appears Once (opens in a new tab)JudgeableEasy
  13. Offer 51Count InversionsOriginal: Count Inversions (opens in a new tab)JudgeableHard
  14. Offer 52Intersection of Two Linked ListsLeetCode 16009 Linked ListsJudgeableEasy

Chapter 6 · Transfer and modeling (53–66)20 problems · 20 judgeable here

  1. Offer 53-IOccurrences in a Sorted ArrayOriginal: Occurrences in a Sorted Array (opens in a new tab)JudgeableEasy
  2. Offer 53-IIWhich Label Is Missing?Original: Which Label Is Missing? (opens in a new tab)JudgeableEasy
  3. Offer 54The k-th Largest Value in a Search TreeOriginal: The k-th Largest Value in a Search Tree (opens in a new tab)JudgeableEasy
  4. Offer 55-IMaximum Depth of Binary TreeLeetCode 10410 Tree TraversalJudgeableEasy
  5. Offer 55-IIBalanced Binary TreeLeetCode 11010 Tree TraversalJudgeableEasy
  6. Offer 56-ISingle Number IIILeetCode 26035 Bits & MathJudgeableMedium
  7. Offer 56-IISingle Number IILeetCode 13735 Bits & MathJudgeableMedium
  8. Offer 57Two Numbers That Hit the Target in a Sorted ArrayOriginal: Two Numbers That Hit the Target in a Sorted Array (opens in a new tab)JudgeableEasy
  9. Offer 57-IIConsecutive Positive Integers That Sum to a TargetOriginal: Consecutive Positive Integers That Sum to a Target (opens in a new tab)JudgeableEasy
  10. Offer 58-IReverse Words in a StringLeetCode 15103 StringsJudgeableMedium
  11. Offer 58-IIMove the Front of a String to the BackOriginal: Move the Front of a String to the Back (opens in a new tab)JudgeableEasy
  12. Offer 59-ISliding Window MaximumLeetCode 23907 Stacks & HeapsJudgeableHard
  13. Offer 59-IIA Queue That Knows Its MaximumOriginal: A Queue That Knows Its Maximum (opens in a new tab)JudgeableMedium
  14. Offer 60How n Dice Add UpOriginal: How n Dice Add Up (opens in a new tab)JudgeableMedium
  15. Offer 61Can Five Cards Make a Straight?Original: Can Five Cards Make a Straight? (opens in a new tab)JudgeableEasy
  16. Offer 62Who Is Left in the Circle?Original: Who Is Left in the Circle? (opens in a new tab)JudgeableMedium
  17. Offer 63Best Time to Buy and Sell StockLeetCode 12129 Stock TradingJudgeableEasy
  18. Offer 64Add 1 Through nOriginal: Add 1 Through n (opens in a new tab)JudgeableMedium
  19. Offer 65Sum of Two IntegersLeetCode 37135 Bits & MathJudgeableMedium
  20. Offer 66Product of Array Except SelfLeetCode 23801 In-place ArraysJudgeableMedium

Chapter 7 · Two interview cases (67–68)3 problems · 3 judgeable here

  1. Offer 67String to Integer (atoi)LeetCode 803 StringsJudgeableMedium
  2. Offer 68-ILowest Common Ancestor of a Binary Search TreeLeetCode 23513 BSTJudgeableMedium
  3. Offer 68-IILowest Common Ancestor of a Binary TreeLeetCode 23611 Tree PathsJudgeableMedium

Where the list comes from

Coding Interviews (剑指 Offer, 2nd ed.) is published by its own authors. This page only maps it by problem number and is not official. The original list: leetcode.cn