News for hackers. Stuff that matters.
Re:Making an Endpoint 50x Faster by mobilemidget on Saturday December 07, 2019 @07:18AM (#21729878)
"Because order should not matter, both arrays are sorted before they are compared."

I do not understand this line very well. If order does not matter, why sort anything?

Re:Making an Endpoint 50x Faster by ignoramous on Saturday December 07, 2019 @11:01AM (#21730919)
Consider character sequences: [n, e, t] and [t, e, n]. If you'd want to know if the lists are equivalent (have the same characters, same number of times), then sorting them would make the comparison straight-forward since order doesn't matter.

See: https://leetcode.com/problems/valid-anagram/solution

Re:Making an Endpoint 50x Faster by mobilemidget on Saturday December 07, 2019 @03:03PM (#21732258)
ah yes but of course, probably did not have enough coffee yet when I read it :) thank you

But then perhaps it is worth storing it sorted ( or as well if original value is important) and making it even faster?

Re:Making an Endpoint 50x Faster by GrayShade on Saturday December 07, 2019 @07:27AM (#21729915)
They order does not matter and can be arbitrary. But when you compare two entries you need to sort them, because the entries are arrays. It's like the trick of converting sttings to lower-case to get an case-insensitive comparison (which is a bad idea in a non-Latin world, but that's another story).