Pular para o conteúdo principal

3 documentos selecionados com "divide-and-conquer"

Ver todas os Marcadores

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.