Sorting

How to Define a Custom Comparison For a std::set

An example of defining a custom comparison for a std::set. A C++ solution for Leetcode 729. My Calendar I.

How To Remove Duplicates From a Sorted Array

Two approaches for solving Leetcode Challenge 80. Remove Duplicates from Sorted Array II. The key is to either erase duplicates beyond two occurrences while preserving order or reassign valid elements (up to two of each) to the first k indexes of nums.