A greedy algorithm builds a solution step by step, always choosing the option that looks best right now. It never reconsiders past choices.
Imagine you are at a buffet and want to maximize deliciousness. A greedy approach: at each dish, take the tastiest item you see. You do not plan ahead or save room for later courses. It works when local optimization leads to global optimization. But it fails when short-term gains cause long-term losses. The key question you need to answer: when can you trust local choices?