Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 1534. Count Good Triplets
Count the number of index triplets (i < j < k) in arr such that the pairwise absolute differences satisfy |arr[i]-arr[j]| ≤ a, |arr[j]-arr[k]| ≤ b, and |arr[i]-arr[k]| ≤ c. With arr.length ≤ 100, the constraints make a direct check over all triplets efficient.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late December, 2024
Mid-level
Count Valid Triples with Absolute Difference Constraints
Early September, 2024
Mid-level
Find triplets i,j,k in a string s where s[i..j] and s[j+1..k] have the same count of distinct characters
Early September, 2024
Mid-level
Given a stream of numbers and a DISTANCE value, find triplets (a, b, c) where the absolute difference between any pair is less than or equal to DISTANCE. Remove found triplets from the stream.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.