Google | onsite | India
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-01-12Added By Anonymous
Source:Ā Link
š§ Experience: unknown
ā Outcome: unknown
š° Compensation: unknown
š Location: India
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
Question : Given an array of length N. find the number of distinct triplets (A[i],A[j],A[k]) in the array where 0<=i<j<k<N
Example : A = { 1,1,1,1,2}
Output : 2
(1,1,1) and (1,1,2).
What is the optimized approach?
ā Outcome: unknown
š° Compensation: unknown
š Location: India
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š Offer Date: unknown
Question : Given an array of length N. find the number of distinct triplets (A[i],A[j],A[k]) in the array where 0<=i<j<k<N
Example : A = { 1,1,1,1,2}
Output : 2
(1,1,1) and (1,1,2).
What is the optimized approach?