Skip to content

Instantly share code, notes, and snippets.

View SophiaHeh's full-sized avatar

SophiaHeh SophiaHeh

View GitHub Profile
@SophiaHeh
SophiaHeh / grokking_to_leetcode.md
Created September 20, 2024 06:30 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@SophiaHeh
SophiaHeh / backtracking_template.py
Created August 21, 2024 19:41 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())