Dsa
Dynamic Programming
Easy
String Edit Distance
Given two strings, calculate the minimum number of operations required to convert one string into the other. The operations allowed are insertion, deletion, or substitution of a single character.
Input:
- The first line contains the first string s1 (1 <= len(s1) <= 100).
- The second line contains the second string s2 (1 <= len(s2) <= 100).
Output:
- A single integer representing the minimum edit distance.
Example:
Input:
kitten
sitting
Output:
3
Key concepts
dynamic_programmingstringmemoization
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now