cswork / listsOpen the problem bank

Mapped by number

Cracking the Coding Interview (6th ed.), mapped

Cracking the Coding Interview (6th ed.)'s 109 problems mapped by number to CSWork: 104 can be judged online here, the rest link out to LeetCode. Not an official list.

104 / 109 judgeable here5 external37 of 109 have a LeetCode twin
Practice this list in the bank →

Chapter 1 · Arrays and Strings9 problems · 7 judgeable here

  1. CtCI 01.01Are All Characters Different?Original: Are All Characters Different? (opens in a new tab)JudgeableEasy
  2. CtCI 01.02LeetCode 242 (opens in a new tab)LeetCode 242External
  3. CtCI 01.03URL-encode Spaces Up to the True LengthOriginal: URL-encode Spaces Up to the True Length (opens in a new tab)JudgeableEasy
  4. CtCI 01.04Palindrome Permutation 🔒LeetCode 26602 HashingJudgeableEasy
  5. CtCI 01.05One Edit AwayOriginal: One Edit Away (opens in a new tab)JudgeableMedium
  6. CtCI 01.06Run-Length CompressionOriginal: Run-Length Compression (opens in a new tab)JudgeableEasy
  7. CtCI 01.07Rotate ImageLeetCode 4801 In-place ArraysJudgeableMedium
  8. CtCI 01.08LeetCode 73 (opens in a new tab)LeetCode 73External
  9. CtCI 01.09Rotate StringLeetCode 79603 StringsJudgeableEasy

Chapter 2 · Linked Lists8 problems · 7 judgeable here

  1. CtCI 02.01Remove Repeats From a List, Keeping the FirstOriginal: Remove Repeats From a List, Keeping the First (opens in a new tab)JudgeableEasy
  2. CtCI 02.02Value of the k-th Node From the EndOriginal: Value of the k-th Node From the End (opens in a new tab)JudgeableEasy
  3. CtCI 02.03Delete Node in a Linked List (opens in a new tab)LeetCode 237ExternalMedium
  4. CtCI 02.04Split a List Around a PivotOriginal: Split a List Around a Pivot (opens in a new tab)JudgeableMedium
  5. CtCI 02.05Add Two NumbersLeetCode 209 Linked ListsJudgeableMedium
  6. CtCI 02.06Palindrome Linked ListLeetCode 23409 Linked ListsJudgeableEasy
  7. CtCI 02.07Intersection of Two Linked ListsLeetCode 16009 Linked ListsJudgeableEasy
  8. CtCI 02.08Linked List Cycle IILeetCode 14209 Linked ListsJudgeableMedium

Chapter 3 · Stacks and Queues6 problems · 6 judgeable here

  1. CtCI 03.01Three Stacks in One ArrayOriginal: Three Stacks in One Array (opens in a new tab)JudgeableEasy
  2. CtCI 03.02Min StackLeetCode 15532 IteratorsJudgeableMedium
  3. CtCI 03.03Stacks of PlatesOriginal: Stacks of Plates (opens in a new tab)JudgeableMedium
  4. CtCI 03.04Implement Queue using StacksLeetCode 23232 IteratorsJudgeableEasy
  5. CtCI 03.05A Stack With the Minimum on TopOriginal: A Stack With the Minimum on Top (opens in a new tab)JudgeableMedium
  6. CtCI 03.06Animal ShelterOriginal: Animal Shelter (opens in a new tab)JudgeableEasy

Chapter 4 · Trees and Graphs10 problems · 10 judgeable here

  1. CtCI 04.01Is There a Route Between Two Nodes?Original: Is There a Route Between Two Nodes? (opens in a new tab)JudgeableMedium
  2. CtCI 04.02Convert Sorted Array to Binary Search TreeLeetCode 10813 BSTJudgeableEasy
  3. CtCI 04.03The Nodes on Each Level of a TreeOriginal: The Nodes on Each Level of a Tree (opens in a new tab)JudgeableMedium
  4. CtCI 04.04Balanced Binary TreeLeetCode 11010 Tree TraversalJudgeableEasy
  5. CtCI 04.05Validate Binary Search TreeLeetCode 9813 BSTJudgeableMedium
  6. CtCI 04.06Inorder Successor in BST 🔒LeetCode 28513 BSTJudgeableMedium
  7. CtCI 04.08Lowest Common Ancestor of a Binary TreeLeetCode 23611 Tree PathsJudgeableMedium
  8. CtCI 04.09Insertion Orders That Build the Same Search TreeOriginal: Insertion Orders That Build the Same Search Tree (opens in a new tab)JudgeableHard
  9. CtCI 04.10Subtree of Another TreeLeetCode 57210 Tree TraversalJudgeableEasy
  10. CtCI 04.12Path Sum IIILeetCode 43711 Tree PathsJudgeableMedium

Chapter 5 · Bit Manipulation7 problems · 7 judgeable here

  1. CtCI 05.01Insert One Number Into Another's BitsOriginal: Insert One Number Into Another's Bits (opens in a new tab)JudgeableEasy
  2. CtCI 05.02Write a Fraction in BinaryOriginal: Write a Fraction in Binary (opens in a new tab)JudgeableMedium
  3. CtCI 05.03Flip One Bit for the Longest Run of OnesOriginal: Flip One Bit for the Longest Run of Ones (opens in a new tab)JudgeableEasy
  4. CtCI 05.04Neighbours With the Same Number of One BitsOriginal: Neighbours With the Same Number of One Bits (opens in a new tab)JudgeableMedium
  5. CtCI 05.06How Many Bits to ChangeOriginal: How Many Bits to Change (opens in a new tab)JudgeableEasy
  6. CtCI 05.07Swap Odd and Even BitsOriginal: Swap Odd and Even Bits (opens in a new tab)JudgeableEasy
  7. CtCI 05.08Draw a Horizontal Line on a Monochrome ScreenOriginal: Draw a Horizontal Line on a Monochrome Screen (opens in a new tab)JudgeableMedium

Chapter 8 · Recursion and Dynamic Programming14 problems · 14 judgeable here

  1. CtCI 08.01One, Two or Three Steps at a TimeOriginal: One, Two or Three Steps at a Time (opens in a new tab)JudgeableEasy
  2. CtCI 08.02Guide a Robot Around ObstaclesOriginal: Guide a Robot Around Obstacles (opens in a new tab)JudgeableMedium
  3. CtCI 08.03Find a Value Equal to Its IndexOriginal: Find a Value Equal to Its Index (opens in a new tab)JudgeableEasy
  4. CtCI 08.04SubsetsLeetCode 7819 EnumerationJudgeableMedium
  5. CtCI 08.05Multiply Without the Times SignOriginal: Multiply Without the Times Sign (opens in a new tab)JudgeableMedium
  6. CtCI 08.06Every Move of the Towers of HanoiOriginal: Every Move of the Towers of Hanoi (opens in a new tab)JudgeableEasy
  7. CtCI 08.07Every Arrangement of Distinct LettersOriginal: Every Arrangement of Distinct Letters (opens in a new tab)JudgeableMedium
  8. CtCI 08.08Arrangements of Letters With RepeatsOriginal: Arrangements of Letters With Repeats (opens in a new tab)JudgeableMedium
  9. CtCI 08.09Generate ParenthesesLeetCode 2220 PartitioningJudgeableMedium
  10. CtCI 08.10Flood FillLeetCode 73314 Grid SearchJudgeableEasy
  11. CtCI 08.11Ways to Make n CentsOriginal: Ways to Make n Cents (opens in a new tab)JudgeableMedium
  12. CtCI 08.12N-QueensLeetCode 5121 PruningJudgeableHard
  13. CtCI 08.13Stack the Tallest Tower of BoxesOriginal: Stack the Tallest Tower of Boxes (opens in a new tab)JudgeableHard
  14. CtCI 08.14Parenthesise a Boolean ExpressionOriginal: Parenthesise a Boolean Expression (opens in a new tab)JudgeableMedium

Chapter 10 · Sorting and Searching7 problems · 7 judgeable here

  1. CtCI 10.01Merge Sorted ArrayLeetCode 8801 In-place ArraysJudgeableEasy
  2. CtCI 10.02Group AnagramsLeetCode 4902 HashingJudgeableMedium
  3. CtCI 10.03Search a Rotated Sorted ArrayOriginal: Search a Rotated Sorted Array (opens in a new tab)JudgeableMedium
  4. CtCI 10.05Find a Word in a Sorted List With GapsOriginal: Find a Word in a Sorted List With Gaps (opens in a new tab)JudgeableEasy
  5. CtCI 10.09Search a 2D Matrix IILeetCode 24006 Binary SearchJudgeableMedium
  6. CtCI 10.10Rank in a StreamOriginal: Rank in a Stream (opens in a new tab)JudgeableMedium
  7. CtCI 10.11Valleys and Peaks, Smallest FirstOriginal: Valleys and Peaks, Smallest First (opens in a new tab)JudgeableMedium

Chapter 16 · Moderate24 problems · 24 judgeable here

  1. CtCI 16.01Swap in Place Without a TemporaryOriginal: Swap in Place Without a Temporary (opens in a new tab)JudgeableEasy
  2. CtCI 16.02How Often Does a Word Appear?Original: How Often Does a Word Appear? (opens in a new tab)JudgeableMedium
  3. CtCI 16.03Where Two Segments MeetOriginal: Where Two Segments Meet (opens in a new tab)JudgeableHard
  4. CtCI 16.04Judge a Tic-Tac-Toe BoardOriginal: Judge a Tic-Tac-Toe Board (opens in a new tab)JudgeableMedium
  5. CtCI 16.05Factorial Trailing ZeroesLeetCode 17235 Bits & MathJudgeableMedium
  6. CtCI 16.06Smallest Difference Between Two ArraysOriginal: Smallest Difference Between Two Arrays (opens in a new tab)JudgeableMedium
  7. CtCI 16.07The Larger Number Without ComparingOriginal: The Larger Number Without Comparing (opens in a new tab)JudgeableEasy
  8. CtCI 16.08Integer to English WordsLeetCode 27303 StringsJudgeableHard
  9. CtCI 16.09Subtract, Multiply and Divide With Addition OnlyOriginal: Subtract, Multiply and Divide With Addition Only (opens in a new tab)JudgeableMedium
  10. CtCI 16.10The Year With the Most People AliveOriginal: The Year With the Most People Alive (opens in a new tab)JudgeableMedium
  11. CtCI 16.11Build a Diving Board From Two Plank SizesOriginal: Build a Diving Board From Two Plank Sizes (opens in a new tab)JudgeableEasy
  12. CtCI 16.13One Line Halving Two SquaresOriginal: One Line Halving Two Squares (opens in a new tab)JudgeableMedium
  13. CtCI 16.14The Line Through the Most PointsOriginal: The Line Through the Most Points (opens in a new tab)JudgeableMedium
  14. CtCI 16.15Mastermind Hits and Pseudo-HitsOriginal: Mastermind Hits and Pseudo-Hits (opens in a new tab)JudgeableEasy
  15. CtCI 16.16The Shortest Range to SortOriginal: The Shortest Range to Sort (opens in a new tab)JudgeableMedium
  16. CtCI 16.17Maximum SubarrayLeetCode 5301 In-place ArraysJudgeableMedium
  17. CtCI 16.18Match a String Against an a/b PatternOriginal: Match a String Against an a/b Pattern (opens in a new tab)JudgeableMedium
  18. CtCI 16.19Pond SizesOriginal: Pond Sizes (opens in a new tab)JudgeableMedium
  19. CtCI 16.20Old Phone Keypad WordsOriginal: Old Phone Keypad Words (opens in a new tab)JudgeableMedium
  20. CtCI 16.21Swap One Pair to Balance Two SumsOriginal: Swap One Pair to Balance Two Sums (opens in a new tab)JudgeableMedium
  21. CtCI 16.22Langton's Ant After K StepsOriginal: Langton's Ant After K Steps (opens in a new tab)JudgeableMedium
  22. CtCI 16.24As Many Pairs Summing to a Target as PossibleOriginal: As Many Pairs Summing to a Target as Possible (opens in a new tab)JudgeableMedium
  23. CtCI 16.25LRU CacheLeetCode 14633 CachesJudgeableMedium
  24. CtCI 16.26Basic Calculator IILeetCode 22707 Stacks & HeapsJudgeableMedium

Chapter 17 · Hard24 problems · 22 judgeable here

  1. CtCI 17.01Sum of Two IntegersLeetCode 37135 Bits & MathJudgeableMedium
  2. CtCI 17.04LeetCode 268 (opens in a new tab)LeetCode 268External
  3. CtCI 17.05The Longest Run With as Many Letters as DigitsOriginal: The Longest Run With as Many Letters as Digits (opens in a new tab)JudgeableMedium
  4. CtCI 17.06How Many 2s Appear?Original: How Many 2s Appear? (opens in a new tab)JudgeableHard
  5. CtCI 17.07Merge Synonymous Baby NamesOriginal: Merge Synonymous Baby Names (opens in a new tab)JudgeableMedium
  6. CtCI 17.08The Tallest Human TowerOriginal: The Tallest Human Tower (opens in a new tab)JudgeableMedium
  7. CtCI 17.09The k-th Number Made of 3s, 5s and 7sOriginal: The k-th Number Made of 3s, 5s and 7s (opens in a new tab)JudgeableMedium
  8. CtCI 17.10The Majority ElementOriginal: The Majority Element (opens in a new tab)JudgeableEasy
  9. CtCI 17.11The Closest Two WordsOriginal: The Closest Two Words (opens in a new tab)JudgeableMedium
  10. CtCI 17.12Increasing Order Search Tree (opens in a new tab)LeetCode 897ExternalEasy
  11. CtCI 17.13Put the Spaces BackOriginal: Put the Spaces Back (opens in a new tab)JudgeableMedium
  12. CtCI 17.14Pick the k SmallestOriginal: Pick the k Smallest (opens in a new tab)JudgeableMedium
  13. CtCI 17.15The Longest Word Made of Other WordsOriginal: The Longest Word Made of Other Words (opens in a new tab)JudgeableMedium
  14. CtCI 17.16House RobberLeetCode 19822 DP BasicsJudgeableMedium
  15. CtCI 17.17Search Many Short Strings in a Long OneOriginal: Search Many Short Strings in a Long One (opens in a new tab)JudgeableMedium
  16. CtCI 17.18The Shortest Range Holding Every TargetOriginal: The Shortest Range Holding Every Target (opens in a new tab)JudgeableMedium
  17. CtCI 17.19The Two Missing NumbersOriginal: The Two Missing Numbers (opens in a new tab)JudgeableHard
  18. CtCI 17.20Find Median from Data StreamLeetCode 29533 CachesJudgeableHard
  19. CtCI 17.21Trapping Rain WaterLeetCode 4204 Two PointersJudgeableHard
  20. CtCI 17.22Change One Letter at a TimeOriginal: Change One Letter at a Time (opens in a new tab)JudgeableMedium
  21. CtCI 17.23The Largest Square With Black BordersOriginal: The Largest Square With Black Borders (opens in a new tab)JudgeableMedium
  22. CtCI 17.24The Submatrix With the Largest SumOriginal: The Submatrix With the Largest Sum (opens in a new tab)JudgeableHard
  23. CtCI 17.25The Largest Rectangle of WordsOriginal: The Largest Rectangle of Words (opens in a new tab)JudgeableHard
  24. CtCI 17.26Similarity of Sparse DocumentsOriginal: Similarity of Sparse Documents (opens in a new tab)JudgeableHard

Where the list comes from

Cracking the Coding Interview (6th ed.) is published by its own authors. This page only maps it by problem number and is not official. The original list: leetcode.cn