Skip to content

Instantly share code, notes, and snippets.

@shobith
shobith / grokking_to_leetcode.md
Created August 18, 2023 15:23 — 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

@shobith
shobith / memoize
Last active August 29, 2015 14:03
memoizing recursive functions in javascript.
// attempt to make a swift-style generic memoize idiom ( https://gist.github.com/berkus/8a9e104f8aac5d025eb5 )
function memoize(body) {
var memo = {};
return function memo_op(param) {
if (memo[param] === undefined)
memo[param] = body(memo_op, param);
return memo[param];
}
}