Amazon interview question

They asked greedy problems mixed with matrix