Amazon Interview Question

Graph algos and adhoc maths