Tap here to switch tabs
Problem
Submissions

Problem: Number of Single Divisor Triplets

Try to solve the Number of Single Divisor Triplets problem.

Statement

Given an integer array nums, return the number of distinct triplets of indices (i, j, k) such that:

  • 0≤0 \leq i, j, k << nums.length

  • i, j, and k are pairwise distinct

  • The sum nums[i] ++ nums[j] ++ nums[k] is divisible by exactly one of nums[i], nums[j], or nums[k]

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Single Divisor Triplets

Try to solve the Number of Single Divisor Triplets problem.

Statement

Given an integer array nums, return the number of distinct triplets of indices (i, j, k) such that:

  • 0≤0 \leq i, j, k << nums.length

  • i, j, and k are pairwise distinct

  • The sum nums[i] ++ nums[j] ++ nums[k] is divisible by exactly one of nums[i], nums[j], or nums[k]

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

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