Tap here to switch tabs
Problem
Submissions

Problem: Count Special Quadruplets

Count Special Quadruplets asks you to count distinct groups of four indices in an array, ordered from left to right, where the first three values add up to the fourth.

Statement

Given an integer array nums indexed starting at 00, determine the total number of distinct quadruplets of indices (a, b, c, d) that satisfy the following conditions:

  • nums[a] + nums[b] + nums[c] == nums[d]

  • 0≤a<b<c<d<0 \le a < b < c < d < nums.length

Constraints:

  • 4≤4 \le nums.length ≤50\le 50

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Special Quadruplets

Count Special Quadruplets asks you to count distinct groups of four indices in an array, ordered from left to right, where the first three values add up to the fourth.

Statement

Given an integer array nums indexed starting at 00, determine the total number of distinct quadruplets of indices (a, b, c, d) that satisfy the following conditions:

  • nums[a] + nums[b] + nums[c] == nums[d]

  • 0≤a<b<c<d<0 \le a < b < c < d < nums.length

Constraints:

  • 4≤4 \le nums.length ≤50\le 50

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