Jane Street Interview Question

Problems on flipping coins.