Beautiful Strings Permute Solution