You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dsa-solutions/lc-solutions/1500-1599/1534-Count-good-triplets.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,14 @@ In this page, we will solve the Count Good Triplets problem using multiple appro
19
19
20
20
Given an array of integers `arr`, and three integers `a`, `b`, and `c`. You need to find the number of good triplets.
21
21
22
-
A triplet `(arr[i], arr[j], arr[k])` is good if the following conditions are true:
22
+
A triplet $(arr[i], arr[j], arr[k])$ is good if the following conditions are true:
23
23
24
-
-`0 <= i < j < k < arr.length`
25
-
-`|arr[i] - arr[j]| <= a`
26
-
-`|arr[j] - arr[k]| <= b`
27
-
-`|arr[i] - arr[k]| <= c`
24
+
-$0 <= i < j < k < arr.length$
25
+
-$|arr[i] - arr[j]| <= a$
26
+
-$|arr[j] - arr[k]| <= b$
27
+
-$|arr[i] - arr[k]| <= c$
28
28
29
-
Where `|x|` denotes the absolute value of `x`.
29
+
Where $|x|$ denotes the absolute value of `x`.
30
30
31
31
Return the number of good triplets.
32
32
@@ -50,9 +50,9 @@ Explanation: No triplet satisfies all conditions.
50
50
51
51
### Constraints
52
52
53
-
-`3 <= arr.length <= 100`
54
-
-`0 <= arr[i] <= 1000`
55
-
-`0 <= a, b, c <= 1000`
53
+
-$3 <= arr.length <= 100$
54
+
-$0 <= arr[i] <= 1000$
55
+
-$0 <= a, b, c <= 1000$
56
56
57
57
---
58
58
@@ -400,5 +400,5 @@ By using these approaches, we can efficiently solve the Count Good Triplets prob
400
400
-**Solution Link:** [Count Good Triplets Solution on LeetCode](https://leetcode.com/problems/count-good-triplets/discuss/762344/Brute-Force-O(n3)-with-JavaC%2B%2B)
0 commit comments