← All problemsSign in

Sequence Alignment

Consider two sequences **A** and **B** comprising of digits 0 to 9, of length **K** and **L** respectively. The distance from **A** to **B** is the total minimum penalty incurred in converting **A** to **B** using the following operations, each of which incurs a penalty as described below. 1. Replacing a digit of **A** with another digit: incurs a penalty of 1. 2. Inserting a digit in **A**: incu

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