@@ -0,0 +1,893 @@
+/**%0A *Given an array of size n, find the majority element. The majority element is the element that appears more than %E2%8C%8A n/2 %E2%8C%8B times.%0A *%0A *You may assume that the array is non-empty and the majority element always exist in the array.%0A */%0Aclass Solution %7B%0A    public int majorityElement(int%5B%5D nums) %7B%0A        Map%3CInteger, Integer%3E map = new HashMap%3C%3E();%0A        for (int num : nums) %7B%0A            if (map.containsKey(num)) %7B%0A                int times = map.get(num) + 1;%0A                map.put(num, times);%0A            %7D else %7B%0A                map.put(num, 1);%0A            %7D%0A        %7D%0A        %0A        int maxCount = Collections.max(map.values());%0A        %0A        int result = 0;%0A        for (Map.Entry entry : map.entrySet())%7B%0A            if (maxCount == (int) entry.getValue()) %7B%0A                result = (int) entry.getKey();%0A            %7D%0A        %7D%0A        %0A        return result;%0A    %7D%0A%7D%0A

Create MajorityElement.java