Count Triplets with Bounded Difference

Company: IBM_11dec

Difficulty: medium