public int majorityElement(int[] nums) {
		int majority = 0;
		int len = nums.length;
		int times = len/2;
		HashMap<Integer,Integer> hm = new HashMap<>();
		for(int i:nums){
			if(hm.get(i)!=null){
				hm.put(i, hm.get(i)+1);
			}else{
				hm.put(i,1);
			}
		}
		for(Map.Entry<Integer,Integer> e:hm.entrySet()){
			if( e.getValue() > times ){
				majority = e.getKey();
				break;
			}
		}
		return majority;
	}