Skip to content

Commit fe0f33f

Browse files
Create 2367.py
1 parent 8c83023 commit fe0f33f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

2001-2500/2367.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)