Microsoft Interview Question

Coding test - 1 graph, 1 DP