Find count of triplets having sum less than or equal to b and subtract count of triplets having sum less than or equal to a - 1.
res = ( countTripletsLessThan ( arr , n , b ) - countTripletsLessThan ( arr , n , a - 1 ) ) NEW_LINE return res NEW_LINE