Hacker News new | ask | show | jobs
by tomcatfish 24 days ago
You do not need a hashtable to check that, code that returns a TRUE if (opt1)|(opt2)|(opt3)|(op4)|(etc) matches or FALSE otherwise works just fine.
1 comments

Of course this works and it's simple, but it's O[n] in the number of options. Perfect hashing is O[1].