There are N heroes with powers and M monsters, where monster j has power p[j] and drops c[j] coins. A hero can defeat any monster whose power is at most his own. For each hero, return the total coins…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.