Skip to content

Instantly share code, notes, and snippets.

@bogsio
Created October 28, 2013 19:36
Show Gist options
  • Save bogsio/7203172 to your computer and use it in GitHub Desktop.
Save bogsio/7203172 to your computer and use it in GitHub Desktop.
test cases for majority
assert(majority([]) is None)
assert(majority(None) is None)
assert(majority([1, 2, 3]) is None)
assert(majority([3, 3, 3]) == 3)
assert(majority([1, 2, 3, 3, 3]) == 3)
assert(majority([1, 2, 3, 4, 5]) is None)
assert(majority([1, 3, 2, 3, 3, 6, 5, 8, 3, 3, 3, 6, 3]) == 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment