Shopee Interview Question

Top k in an array; Topological sort