except that when you talk about "approach", you're normally talking about the algorithmic aspects...
The code is concise. There are a bunch of criterias to evaluate a solution, big-O notation is one of them.
not a great approach at all! this is O(n² log n)!
Sample tests (in JS) are broken:
"ReferenceError: objectEqual is not defined
Resolving dangling ticket