NeetCode #535LC-1481MediumHeap / Priority Queue
← Back to All Problems#535 · #1481 · Least Number of Unique Integers after K Removals(不同整数的最少数目)
📌 Problem Statement & Constraints
Given an integer array
arr and an integer k, remove exactly k elements so that the number of distinct remaining integers is minimised. Return that minimum. Constraints: 1 <= arr.length <= 10^5, 1 <= arr[i] <= 10^9, 0 <= k <= arr.length.🔒
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!