Get hash on inteval from L to R and compare two substring