Skip to main content

3 docs tagged with "divide-and-conquer"

View all tags

Majority Element

High school students are voting for their class president and you're tasked with counting the votes. Each presidential candidate is represented by a unique integer and the candidate that should win the election is the candidate that has received more than half the votes. Given a list of integers, return the candidate that should become the class president.