Skip to content

Instantly share code, notes, and snippets.

@sevleo
sevleo / scoreFunction.test.ts
Created July 8, 2024 17:18
Task 2. Develop Tests for the Game Score Determination Function
import {
generateStamps,
getScore,
Stamp,
TIMESTAMPS_COUNT,
OFFSET_MAX_STEP,
} from "./scoreFunction";
beforeAll(() => {
gameStamps = generateStamps();
@sevleo
sevleo / scoreFunction.ts
Created July 8, 2024 17:16
Task 1. Develop a Function to Determine the Score in a Game
export const TIMESTAMPS_COUNT = 50000;
export const PROBABILITY_SCORE_CHANGED = 0.01;
export const PROBABILITY_HOME_SCORE = 0.45;
export const OFFSET_MAX_STEP = 3;
type Score = {
home: number;
@sevleo
sevleo / grokking_to_leetcode.md
Created October 20, 2023 13:20 — 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