diff --git a/src/3375.minimum-operations-to-make-array-values-equal-to-k.3621/solution.java b/src/3375.minimum-operations-to-make-array-values-equal-to-k.3621/solution.java new file mode 100644 index 00000000..057340c8 --- /dev/null +++ b/src/3375.minimum-operations-to-make-array-values-equal-to-k.3621/solution.java @@ -0,0 +1,14 @@ +class Solution { + public int minOperations(int[] nums, int k) { + int count = (int)Arrays.stream(nums).distinct().count(); + + int min = nums[0]; + for(int n:nums){ + min = Math.min(min,n); + } + if(k>min){ + return -1; + } + return count-( k