string permutation check