NeetCode #109LC-229MediumArrays & HashingNC 250
← Back to All Problems#109 · #229 · Majority Element II(多数元素 II)
📌 Problem Statement & Constraints
Given an integer array
nums of size n, find all elements that appear more than n / 3 times. Constraints: 1 <= n <= 5 * 10^4, -10^9 <= nums[i] <= 10^9. The solution must run in O(n) time and use O(1) space.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!