Tap here to switch tabs
Problem
Submissions

Problem: Count Equal and Divisible Pairs in an Array

Count Equal and Divisible Pairs in an Array asks you to count pairs of positions with equal values where the first comes earlier and their index product is divisible by k.

Statement

Given a 00 indexed integer array nums and an integer k, determine the total number of index pairs (i, j) satisfying 0≤0 \leq i << j << nums.length such that nums[i] == nums[j] and (i ⋅\cdot j) is divisible by k.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i], k ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Equal and Divisible Pairs in an Array

Count Equal and Divisible Pairs in an Array asks you to count pairs of positions with equal values where the first comes earlier and their index product is divisible by k.

Statement

Given a 00 indexed integer array nums and an integer k, determine the total number of index pairs (i, j) satisfying 0≤0 \leq i << j << nums.length such that nums[i] == nums[j] and (i ⋅\cdot j) is divisible by k.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i], k ≤100\leq 100