Data Structures
Relative Sort Array
Relative Sort Array (LeetCode 1122): sort by the order defined in a second array, with the rest sorted ascending. O(n log n), Python/Java/C++.
2 notes tagged
Relative Sort Array (LeetCode 1122): sort by the order defined in a second array, with the rest sorted ascending. O(n log n), Python/Java/C++.
Custom Sort String (LeetCode 791): sort one string by the character priority defined in another, using a rank map. O(n log n) or O(n), Python/Java/C++...