HackerEarth interview question

Graph-Based, Bit manipulation, Greedy solution and DP