Sponsored
Use these hints if you're stuck. Try solving on your own first.
Which triplets do you actually care about?
What property of max can you use to solve the problem?
Solve with full IDE support and test cases