Thanks for this, made a lot of things clear. On the topic of storing an array of possible values @ a hash index, you said O(n) complexity, but in reality a classic for loop rather than forEach could break on the first match so it’s only O(n) in the worst scenario. Is there a way to describe that in terms of complexity?

I make UIs and such. Using JS mostly but I like to dabble.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store