Goldman Sachs Interview Question

Some leetcode medium problem; some basic probability questions