import java.util.*;
public class Solution {
    public int MoreThanHalfNum_Solution(int [] array) {
        if(array.length==1) return array[0];
        Arrays.sort(array);
        int k=(array.length-1)%2==0?(array.length-1)/2:(array.length-1)/2+1;
        return array[k];
    }
}