Skip to content

Commit 47464af

Browse files
committed
Do daily but oneliner
1 parent 21816a7 commit 47464af

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution:
2+
def countGoodTriplets(self, arr: List[int], a: int, b: int, c: int) -> int:
3+
return [
4+
abs(arr[i] - arr[j]) <= a and abs(arr[j] - arr[k]) <= b and abs(arr[i] - arr[k]) <= c
5+
for i in range(len(arr) - 2) for j in range(i + 1, len(arr) - 1) for k in range(j + 1, len(arr))
6+
].count(True)

0 commit comments

Comments
 (0)