code for suffix array div 1