← All problemsSign in

Distinct Number

You are given two arrays $A$ and $B$ each of length $N$. Now you are given two pair of ranges i.e. a range $[a,b]$ in the array $A$ and range $[c,d]$ int the array $B$. For each query, you need to count distinct elements in the array which is formed by combining elements of the both ranges in the query. ###Input: - The first line contains an integer $N$ as input. - Next line contains $N$ sp

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