Edit Distance
Calculate minimum edits (insert, delete, replace) to convert word1 to word2 Example: word1 = "horse", word2 = "ros" => 3 horse -> rorse (replace 'h' with 'r') rorse -> rose (remove 'r') rose -> ros (remove 'e')
Edit Distance is a dynamic programming question: define the state cleanly and the transitions usually follow. Interviewers love it because it reveals your state-and-transition thinking and your edge-case discipline. The trap is picking a state that's too vague; keep it minimal and consistent.

Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Sign in free to type with Coco, up to a daily limit, and to talk with her for one hour. After that, talking comes with the $79 pack. Anyone can open the editor and run their code.