string permutation linear time