Thoucentric Interview Question

Coding from data structure. Time complexity.