← All problemsSign in

Subarray And Array

Given two array $A_{1}, A_{2}, A_{3},..., A_{n}$ of size $n$ and $B_{1}, B_{2}, B_{3}... B_{m}$ of size $m$. You have to find a subarray of array $A$ such that its size is atleast $m$, let it be $A_{i}, ... ,A_{i+k-1}$ which can be denoted by $arr_{1}, arr_{2}, ... arr_{k} (k >= m)$. Now randomly select $exactly$ $m$ elements from the subarray $arr_{1}, arr_{2}, arr_{3}, ... arr_{k}$ . L

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