Leetcode - Advantage Shuffle (Python)

preview_player
Показать описание
March 2021 Leetcode Challenge
Leetcode - Advantage Shuffle #870
Difficulty: Medium
Рекомендации по теме
Комментарии
Автор

Starting from the largest one in B is such a very cool approach that you can get the answer in a scan.

xiangliangmeng
Автор

I was able to come up with the "thought process" but I was only able to come up with a "greedy approach" that averaged to O(n^2). Very clever way of sorting with the indices