2367. Number of Arithmetic Triplets Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 2367class Solution: def arithmeticTriplets(self, nums: List[int], diff: int) -> int: vis = set(nums) return sum(x + diff in vis and x + diff * 2 in vis for x in nums)