We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c83023 commit fe0f33fCopy full SHA for fe0f33f
2001-2500/2367.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def arithmeticTriplets(self, nums: List[int], diff: int) -> int:
3
+ ans = 0
4
+ s = set(nums)
5
+ for num in nums:
6
+ if num+diff in s and num+2*diff in s:
7
+ ans += 1
8
+ return ans
9
+
0 commit comments