Glossary: Coding Interviews in Go
Sort first
Also written: pattern 2
Sorting the input so items that belong together become neighbors. It costs O(n log n) and helps with 'closest' and 'group together' problems.
Glossary: Coding Interviews in Go
Also written: pattern 2
Sorting the input so items that belong together become neighbors. It costs O(n log n) and helps with 'closest' and 'group together' problems.