Hi, I'm having trouble understanding the solution of the following problem http://mirror.codeforces.com/contest/802/problem/I using Suffix Array, that is, the first solution in Editorial. Can someone more familiar with Suffix Array explain the solution to me?