Kevin and Array
CodeChefOpen on judge ↗
Problem Statement Kevin has an array a consisting of n elements. He defines an operation f as maximum of absolute difference between the adjacent elements of the array. If 0nf is 0. He wants to minimize the value of f for the array a. For this, he is allowed to replace atmost k elements of the array with any integer. Help Kevin to find the minimum value of f for the array. Input: First line con
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