Solution for unique chars using sort