gfg greedy algorithm questions