Gasan_Guseyn's blog

By Gasan_Guseyn, history, 3 years ago, In Russian

How to compare two strings for o (1)

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hash the strings.

Preprocessing will be $$$O(n)$$$.

The comparing will be in $$$O(1)$$$