← All problemsSign in

Sherlock and the Perfect Array

Watson, from one of his programmer friends, finds out about the site codechef. Fascinated by the questions, he decides to make a question himself. He defines a pair of numbers (x,y) a perfect pair if at least one of the numbers is greater than a given number K. Now he wants to find out that given an array A (1-based index) of size N, and an operation (defined below) what should be the minimum numb

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