算法训练营Day12|169.多数元素
学习任务
给定一个大小为 n 的数组 nums ,返回其中的多数元素。多数元素是指在数组中出现次数 大于
[n/2]的元素。
你可以假设数组是非空的,并且给定的数组总是存在多数元素。
题目链接:https://leetcode.cn/problems/majority-element/
官方题解:https://leetcode.cn/problems/majority-element/solutions/146074/duo-shu-yuan-su-by-leetcode-solution/
