Quiz - 13

Develop the function remove_duplicates that receives a list numbers of integers. The function should return a list without repeated elements and sorted in ascending order.

Examples:
remove_duplicates([1, 2, 2, 3]) -> [1, 2, 3]
remove_duplicates([1, 2, 3]) -> [1, 2, 3]
remove_duplicates([1, 2, 2, 1]) -> [1, 2]

Develop the function encrypt that receives a string phrase. The function should return a new encrypted string, following these rules:

  1. All repeated letters must be removed from each word of the phrase.

  2. The remaining letters in each word must be sorted.

Example:
encrypt("anita lava la tina") -> "aint alv al aint"
Tip: try converting the phrase into a list of words, then try sorting the letters and build a string with the result.

You have attempted of activities on this page