Mind Palace
CodeChefOpen on judge ↗
"It's a memory technique, a "SORT" of mental map. All you have to do is find your way back to it." Moriarty challenges Sherlock by giving him $N$ sequences of integers such that all given integers are distinct. Sherlock decided to merge all the sequences into a single lexicographically smallest sequence and store that sequence in his Mind Palace, such that, all the original sequences are subseq
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