← All problemsSign in

Problem 3

Dinesh and Cheenu are playing a game. Given an array A consisting of M positive integers, list all continuous non-empty subarrays of array A and replace all the subarrays with the maximum element present in the respective subarray. They both make moves turn by turn. In one turn, the player picks some number from the list and discards that number. The one who is not able to make a valid move will

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start