Created
April 9, 2021 19:18
-
-
Save olumidayy/7ce29b823848e012299b539286080282 to your computer and use it in GitHub Desktop.
Algorithm fridays Week 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_of_unique_elements (array): | |
return len(set(array)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really interesting solution you got here @olumidayy and thank you for participating in Week 1 of Algorithm Fridays.
Your solution works and passes most of the test cases. The one thing I will say is that your solution doesn't check to see if
array
has anull
value because if I passNone
as input to your function, it breaks. Ideally, you want to write code that is robust and doesn't fail on edge cases.I have posted my solution here, let me know what you think.