You're a warrior with initial strength facing dragons. Each dragon has a strength level and a bonus you gain after defeating it. You can only defeat a dragon if your current strength is strictly greater than the dragon's strength.
Your task: determine if you can defeat all dragons by choosing them in the right order. If yes, output that order. This tests your understanding of sorting and how order affects outcomes.
Before reading on, think: if you have strength and face dragons with strengths and , which should you fight first? Why does order matter here?