Find permutation of given string or array