Make a perfect Split
CodeChefOpen on judge ↗
A non-empty zero-indexed array A consisting of N integers is given. Any integer k, such that 0 , splits array A into two non-empty parts: A[0],A[1]...,A[K] and A[K+1],A[K+2],...,A[N-1] The difference between the two parts is the value of abs(max{A[0],A[1],...A[K]} - max{A[K+1],A[K+2],...A[N-1]}), where abs is absolute difference function. For example in following Array A: {1,3,-3} Can be divided
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