Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Sum Len Boolean solution in Clear category for Majority by Striga
def is_majority(items: list) -> bool:
return sum(items) > len(items)/2
if __name__ == '__main__':
assert is_majority([True, True, False, True, False]) == True
assert is_majority([True, True, False]) == True
assert is_majority([True, True, False, False]) == False
assert is_majority([True, True, False, False, False]) == False
assert is_majority([False]) == False
assert is_majority([True]) == True
assert is_majority([]) == False
Oct. 29, 2020