Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can we use sorting here along with a custom comparator?
For any two enemies <code>i</code> and <code>j</code> with damages <code>damage[i]</code> and <code>damage[j]</code>, and time to take each of them down <code>t<sub>i</sub></code> and <code>t<sub>j</sub></code>, when is it better to choose enemy <code>i</code> over enemy <code>j</code> first?