Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktoparrays · three-sum · distinctness
The organizer’s problem statement is available at the official source link.
three book sum
Find three distinct books matching the coupon value
Choose three different catalogue entries whose prices sum exactly to the coupon value.
| Book indices | Distinctness | Coupon condition |
|---|---|---|
| i < j < k | three different books | price_i + price_j + price_k = coupon value |
- 1
Choose distinct entries
Select three different book indices i, j, and k. - 2
Match the coupon
Their three prices must sum exactly to M. - 3
Return a valid triple
Report any matching triple, or the no-solution result when none exists.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.