← All problemsSign in

Counting Triplets

Srinivas Ramanujan has got a typical problem in Mathematics . He has been given some integers and he needs to find triplets among them whose sum must be less than the integer specified by his class teacher. So, let us help him in solving that problem Problem description You are given n distinct integers and from them you need to find the number of triplets whose sum is less than S Input - "T

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start