wrote SuffixArray
fix malloc error