We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 704285e commit caacc38Copy full SHA for caacc38
javascript/1512-number-of-good-pairs.js
@@ -0,0 +1,15 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {number}
4
+ */
5
+var numIdenticalPairs = function (nums) {
6
+ let result = 0;
7
+ for (let i = 0; i < nums.length; i++) {
8
+ for (let j = i + 1; j < nums.length; j++) {
9
+ if (nums[i] == nums[j]) {
10
+ result++;
11
+ }
12
13
14
+ return result;
15
+};
0 commit comments