diff --git a/Leetcode/Make Array Zero by Subtracting Equal Amounts.java b/Leetcode/Make Array Zero by Subtracting Equal Amounts.java new file mode 100644 index 00000000..7bb1369b --- /dev/null +++ b/Leetcode/Make Array Zero by Subtracting Equal Amounts.java @@ -0,0 +1,12 @@ +class Solution { + public int minimumOperations(int[] nums) { + Set st = new HashSet(); + for(int i : nums){ + if(i!=0){ + st.add(i); + } + } + + return st.size(); + } +}