Assign next rank to every suffix
for i in range ( n ) : NEW_LINE INDENT nextindex = suffixes [ i ] . index + k // 2 NEW_LINE suffixes [ i ] . rank [ 1 ] = suffixes [ ind [ nextindex ] ] . rank [ 0 ] if ( nextindex < n ) else - 1 NEW_LINE DEDENT