Data Structures & AlgorithmsHardProduct-company MCQ pattern

What is the edit distance (insert, delete, replace, each cost 1) between FLASK and FLOSSY?

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 5

Correct answer: A. 3

Keep F L; replace A → O; keep S; replace K → S; insert Y: 3 operations, and the DP table confirms no 2-step way exists because the lengths differ by 1 and two letters also differ. Counting a replace as delete + insert gives 5.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic