Given two suffix arrays \(A_{1}\) and \(A_{2}\) for two sequences \(S_{1}\) and \(S_{2}\) it's not completely trivial to construct a single suffix array \(A\) for \(S=S_{1}\parallel S_{2}\) because of the boundary conditions. Instead, we don't build the data \(S=S_{1}\ ||\ S_{2}\) but rather let \(S_{1}^{\prime}=S_{1}\ ||\ S_{2}[uptoK]\) for some \(K\) greater than the longest substring match. Then we build the arrays on \(S_{1}^{\prime}\) and \(S_{2}\). To merge the arrays together we can remove the items from the first array after index \(|S_{1}|\) and merge-sort insert them into the second.