Problem
Given an integer array of sizen, find all elements that appear more than ⌊n / 3⌋ times.
Examples
Constraints
- 1 <= nums.length <= 5 * 10^4
- -10^9 <= nums[i] <= 10^9
O(1) space?
Tested Python solution for LeetCode 229 with 15 pytest cases. Generate a practice environment with lcpy.
n, find all elements that appear more than ⌊n / 3⌋ times.
O(1) space?