LeetCode 题解 169. Majority Element(查找多数元素)

(尊重劳动成果,转载请注明出处:http://blog.csdn.net/qq_25827845/article/details/70917827冷血之心的博客)

欢迎关注微信公众号(文强的技术小屋),学习更多技术知识,一起遨游知识海洋~

开始在LeetCode上多学习别人的算法,加油~~~

题目链接地址:https://leetcode.com/problems/majority-element/#/description

题目描述:

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element always exist in the array.

解析:

你可能感兴趣的:(LeetCode)