← All problemsSign in

Plan of Scofield

Michael Scofield is given N pairs of numbers. A pair (c, d) can follow another pair (a, b) if b . Chain of pairs can be formed in this fashion. Find the length of longest chain which can be formed from a given set of pairs. Input First line contains N, denoting the no. of pairs. Next 2*N lines are in the following pattern: 1. First line contains X(first value of the pair). 2. Second line con

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