Loading...

Triangle Validator

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
senior

Problem

Our manufacturing QA system needs to verify which combinations of rod lengths from a batch can form valid triangles. Write a function called count_triangles that returns the number of unique triplets satisfying the triangle inequality - each rod used once per triplet, order doesn't matter.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.