diff --git a/E_1512_NumberOfGoodPairs.java b/E_1512_NumberOfGoodPairs.java new file mode 100644 index 0000000..51a9098 --- /dev/null +++ b/E_1512_NumberOfGoodPairs.java @@ -0,0 +1,12 @@ +public class Solution { + public int numIdenticalPairs(int[] nums) { + int sonuc = 0; + for (int i = 0; i < nums.length; i++) { + for (int j = 0; j < nums.length; j++) { + if (nums[i] == nums[j] && i < j){ + sonuc++; + } + } + } return sonuc; + } +} \ No newline at end of file