โ† Amazon questions

Count possible triangles from an array

Filed under Amazon

Given an array of positive integers, count the number of triplets (i, j, k) such that they can form the sides of a triangle (a+b > c, a+c > b, b+c > a).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.