"big O / data structure aren't import"
I wrote an quick example for a colleague internally using for + indexOf and splice (
#1
) then rewrote with an alternative approach (
#2
), both solutions with 10x input were averaging 4ms.
then changed to 40000x input: