← All problemsSign in

Strange Problem

Dr. Strange is tired of Spider Man's unjust demands and wants to make him quiet once and for all. He presented the following challenge to Spider Man. Given two arrays $X$ and $Y$ of length $N$. Let’s define a process named score collection for a range of indices as follows : For a given range of valid indices $[i,j]$, you visit each index $i\le k\le j$ and collect an integer value $V∈[X_k,Y_k]$

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