Beginner's friendly solution 🔥 | Simple and easy to understand ✅
IntuitionApproach
Use two nested loops to generate all pairs (i, j), ensuring i < j.
Check if nums[i] === nums[j] to ensure they are equal.
Compute the product
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
1.	Use two nested loops to generate all pairs (i, j), ensuring i < j.
2.	Check if nums[i] === nums[j] to ensure they are equal.
3.	Compute the product of indices (i * j) and check divisibility by k.
4.	If both conditions are met, increment the count.
5.	Return the count after processing all pairs.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
If you found my solution helpful, I’d really appreciate it if you could give it an upvote! 🙌 Your support keeps me motivated to share more simple and efficient solutions. Thank you! 😊

# Code
```javascript []
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var countPairs = function (nums, k) {
    let count = 0
    for (let i = 0; i < nums.length; i++) {
        for (let j = i + 1; j < nums.length; j++) {
            if (nums[i] === nums[j]) {
                let ans = i * j
                if (ans % k === 0) count++
            }
        }
    }
    return count
};
```
['JavaScript']