Varun and Loan
CodeChefOpen on judge ↗
Mr Varun loves to borrow. He has a habit of defaulting on loans. But this time the court decided to reprimand him. They gave him a task. He was given array A of N positive integers and asked to select 4 numbers w, x, y, z such that A[x] – A[w] + A[z] – A[y] is maximum and w x y z Input The first line contains the number of test cases t. Each test case begins with a single integer n. The next lin
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