← All problemsSign in

Chocolate Pairs

One day Vishesh went to a fair where he enjoyed a lot, and while returning home he had $K$ rupees left with him. He went to a chocolate shop where he wanted to buy a pair of chocolates such that sum of prices of both the chocolates amounts to $K$ rupees.There are $N$ chocolates available in the shop and the $i$th chocolate has a price $Ci$. Help Vishesh to find the number of pairs with sum equal 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