Kotlinlearncs.online LogoJava
Return to List

Homework: List to Set

Created By: Geoffrey Challen
/ Version: 2021.9.0

Given a List of Strings, write a method toSet that converts the List to a Set of Strings that contains all the same Strings in the original list. So given a List containing "test", "me", and "test", you would return a Set containing "test" and "me". assert that the passed List is not null.

Related Lessons

Stuck? You may find these lessons helpful: