Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 393 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 393 Bytes

Count of triplets

Given an array of unique integers and a sum value, can you use python to find the number of triplets with a sum smaller than the given value?

Example:

Array of integers = {5, 1, 3, 4, 7} 
Value = 12 
Solution: 4 (e.g. the output of your code) 

Explanation: There are 4 triplets that have a sum less than 12: (1, 3, 4), (1, 3, 5), (1, 3, 7), and (1, 4, 5)