
[LeetCode] 3375. Minimum Operations to Make Array Values Equal to K (Python)

·
알고리즘/LeetCode
난이도: EasyProblem DescriptionYou are given an integer array nums and an integer k. An integer h is called valid if all values in the array that are strictly greater than h are identical. For example, if nums = [10, 8, 10, 8], a valid integer is h = 9 because all nums[i] > 9 are equal to 10, but 5 is not a valid integer. You are allowed to perform the following operation on nums:Select an integer ..