Chef and Range
CodeChefOpen on judge ↗
The range of an array is defined as the difference between the maximum and minimum value in it. Chef comes up with a crazy idea to minimize the range by changing atmost $3$ elements in the array. He wants to check whether the minimum range he gets is right or not. Please help him in verifying his answer. ###Input: - First line will contain $T$, number of testcases. Then the testcases f
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.
Sign in to chat with the tutor and save your progress.
Sign in to start