Ditto
It's O(n^2), not O(n^2 * log(n)). Python caches the sorting criteria, so the code translates into: sorted(LINEAR_FUNCTION(x) for x in arr).
O(n^2)
O(n^2 * log(n))
sorted(LINEAR_FUNCTION(x) for x in arr)
we should get a button to downvote best practices, and cleverness
Loading collection data...
Ditto
It's
O(n^2)
, notO(n^2 * log(n))
. Python caches the sorting criteria, so the code translates into:sorted(LINEAR_FUNCTION(x) for x in arr)
.we should get a button to downvote best practices, and cleverness