Citadel Online Assessment | Triplets | Citadel OA 2022

Given an array of n distinct integers, and an integer threshold, how many (a,b,c) index triplets exists that satisfy both of the following conditions?


This is a companion discussion topic for the original entry at https://algo.monster/problems/triplets/