Skip to content

Instantly share code, notes, and snippets.

@olumidayy
Created April 9, 2021 19:18
Show Gist options
  • Save olumidayy/7ce29b823848e012299b539286080282 to your computer and use it in GitHub Desktop.
Save olumidayy/7ce29b823848e012299b539286080282 to your computer and use it in GitHub Desktop.
Algorithm fridays Week 1
def number_of_unique_elements (array):
return len(set(array))
@mejtfk
Copy link

mejtfk commented Apr 12, 2021

No stress

@meekg33k
Copy link

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 a null value because if I pass None 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment