Amazon Interview Question

They asked greedy problems mixed with matrix