We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21816a7 commit 47464afCopy full SHA for 47464af
my-submissions/e1534_v2_brute_force_oneliner.py
@@ -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