Quantiphi Interview Question

Data structures and Time complexity