Sorting: Bubble Sort
solution
1 | def countSwaps(a): |
analysis
- time complexity
O(n^2) - space complexity
O(1)
Mark and Toys
solution
1 | def maximumToys(prices, k): |
analysis
- time complexity
O(nlogn) - space complexity
O(1)
Sorting: Comparator
solution
1 | from functools import cmp_to_key |