building-a-list solution using TreeSet<String>