A.13: Open Practice


The following is a list of curated Leetcode problems we can work on daily after learning algorithms fundamentals. The problems are taken from the Top Interview Questions list in Leetcode, sorted in decreasing acceptance rate, i.e. % of submissions that were accepted on Leetcode.
The majority of algorithms interviews Rocket grads have encountered have focused on arrays and hash tables. If you find yourself stuck on a problem focusing on a different data structure, feel free to skip and focus on the array and hash tables problems first.


Day 1

Day 2

  1. 1.
    1. 1.
      Feel free to skip the follow up question to implement this traversal iteratively. The iterative implementation is challenging and unlikely to appear in coding interviews.

Day 3

  1. 2.
    1. 1.
      Hint: How can we traverse a BST in sorted order?
  2. 3.
    1. 1.
      Hint: Recall our solution to the kth-largest element in a stream problem:โ€‹

Day 4

  1. 1.
    1. 1.
      Hint: To instantiate a TreeNode class, the syntax is new_node = TreeNode(...), replacing ... with the initialisation parameters.
  2. 2.
    1. 1.
      Hint: Solving this in O(n) without division is a bit of a trick. Feel free to solve it with division and move on.
    2. 2.
      If you're keen on solving it without division: Can we pre-process the data and create intermediate data structures in O(n) time such that we can then fill in the answer array with a single loop?

Day 5

  1. 2.
    1. 1.
      Hint: What combination of arrays and hash tables can we use to group anagrams?
    2. 2.
      Rocket solution code:โ€‹
    3. 3.
      Rocket solution video:โ€‹

Day 6

Day 7

  1. 3.
    1. 1.
      Hint: This is a base-26 numbering system. Requires a more math background to understand how numbers and exponents work. Feel free to skip.

Day 8

Day 9

Day 10

Day 11

  1. 1.
    1. 1.
      Completing this problem will help us understand how to use and implement classes in Python.
    2. 2.
      Hint: An iterator works like this: Each time we call next() on the iterator it will return the next element in the collection. When the iterator is "exhausted", i.e. we have reached the end of the collection, next() will return None.
    3. 3.
      Hint: For a refresher on how to use and implement classes in Python, see code examples from Rocket's OOP module.

Day 12

Day 13

Day 14

Day 15

Day 16

Day 17

Day 18

Day 19

Day 20

Day 21

Day 22

Day 23

Day 24

Day 25

Day 26

Day 27

Day 28

Day 29

Day 30

Day 31

Day 32

Day 33

Day 34

Day 35

Day 36

Day 37

Day 38

Day 39

Day 40