Arrays and queries
CodeChefOpen on judge ↗
You are given an array A of N elements You have performed Q queries in it in each query, you select an index I (0. based ) and perform the following operation For j = I + 1 to N-1; If A[j] < A[I]; A[j] = 0 You are required to print the version of array A after all the Q queries are Proceed Note : The queries are not independent of each other, therefore you are required to use the updated array
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