Neural Ninjas · DSA Simulation Labs · Lab 49

🔤 The LCS Diagonal Trace

One string down the rows, the other across the columns. Matching characters step diagonally, adding one to whatever's already up-and-left. Everything else just copies the bigger of up or left. Trace the diagonals backward from the corner, and the common subsequence spells itself out.

Fill Log

Controls

↘️ MatchWhen both letters agree, I step diagonally — up and left by one — and add exactly 1. A shared letter is only ever counted this way, never any other.
↔️ MismatchNo match here — I just copy whichever neighbor is bigger, straight up or straight left. No new letter gets added.
Pick a level above to begin.