Skip to content

Commit

Permalink
2176 added.
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Mar 4, 2023
1 parent 8d7a6f8 commit b91f782
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions E_2176_CountEqualandDivisiblePairsInAnArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Solution {
public int countPairs(int[] nums, int k) {
int ret=0;
for(int i=0; i<nums.length; i++){
for(int j=i+1;j<nums.length;j++){
if(nums[i]==nums[j]){
if(i*j%k==0)
ret++;
}
}
}
return ret;
}
}

0 comments on commit b91f782

Please sign in to comment.