Competitive Programing Problem Solutions/String/Suffix Array O(nlogn)-sj.cpp
int compare(int i, int j, int n, int k)
{
    pii a = {c[k][i], c[k][(i+1-(1<<k))%n]};
    pii b = {c[k][j], c[k][(j+1-(1<<k))%n]};
    return a == b ? 0 : a < b ? -1 : 1;
}
/// compare two suffixes starting at i and j with length 2^k

compare two suffixes starting at i and j with length 2^k
compare two suffixes starting at i and j with length 2^k
int compare(int i, int j, int n, int k)
{
    pii a = {c[k][i], c[k][(i+1-(1<<k))%n]};
    pii b = {c[k][j], c[k][(j+1-(1<<k))%n]};
    return a == b ? 0 : a < b ? -1 : 1;
}
int compare ( int i , int j , int n , int k ) { pii a = { c [ k ] [ i ] , c [ k ] [ ( i + 1 - ( 1 << k ) ) % n ] } ; pii b = { c [ k ] [ j ] , c [ k ] [ ( j + 1 - ( 1 << k ) ) % n ] } ; return a == b ? 0 : a < b ? -1 : 1 ; }
compare two suffixes starting at i and j with length 2^k
compare two suffixes starting at i and j with length 2^k