You are given a nums and a positive integer diff.
A triplet of indices (i, j, k) is defined as an arithmetic triplet if the following conditions are satisfied:
i j k
nums[j] nums[i] diff
nums[k] nums[j] diff
Return the total number of unique arithmetic triplets.
Constraints:
nums.length
nums[i]
diff
nums is strictly increasing.
You are given a nums and a positive integer diff.
A triplet of indices (i, j, k) is defined as an arithmetic triplet if the following conditions are satisfied:
i j k
nums[j] nums[i] diff
nums[k] nums[j] diff
Return the total number of unique arithmetic triplets.
Constraints:
nums.length
nums[i]
diff
nums is strictly increasing.