Unique Elements
Lesson 3 of 12 in Coddy's Python Interview Series course.
Challenge
EasyWrite a function unique_elements that takes a list and returns a new list with unique elements of the first list.
a1- integer-array
And outputs an integer array, which contains unique elements of a given list
Example:
Input - [1,1,1,1,2,2,3,3,3,3,4,5]
Expected Output - [1, 2, 3, 4, 5]
Try it yourself
def unique_elements(a1):
# Write code hereAll lessons in Python Interview Series
1Crack Python Coding Interview
Lesser of two evensPangram Unique ElementsAnimal CrackersSpy GameMatching StringPalindrome or NotBlackJackFind DuplicatesEncodeHash 33First Non-Repeating Character