Interesting!? N*M*M~5 000 000 substring Let most of them are bad (or having equal copy). For equal string hash is equal and each bad substring must be compared at whole length ~ 50 with something. Thus we have 250 000 000 operations. I think that successful authors applied some string compressing.