One may write a few chapters in an algorithmic book for greedy algorithms. The funny part about them, is that there are a set of algorithmic problems, where the greedy solution tends to be the best one. What exactly is…