3 ms·
If you can get a naive n^2 solution, or build a complicated nlgn solution, and you know the size of the data will be ~100 items, certainly never >1000 solutions
by bcbrown 12y ago
If you can get a naive n^2 solution, or build a complicated nlgn solution, and you know the size of the data will be ~100 items, certainly never >1000 solutions, I'd choose the naive solution.
Edit: and it's not in the middle of a tight loop