Connections
CodeChefOpen on judge ↗
Harshit and Aman, being in different halls, face connectivity issues very frequently. They each have arrays $a$ and $b$ containing $x$ & $y$ signals respectively. Signal $a_i$ can connect with signal $b_j$ only if $a_i=b_j$. Also, the connections shouldn't cross. Formally, if a connection exists between $a_i$ & $b_j$, then $a_k(k>i)$ can only connect with $b_l(l>j)$. Find out the **maximum** num
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