Data Structures & AlgorithmsModerateTCS NQT · Infosys

What is the minimum number of letters you must insert (into either string) so that "leetcode" and "codeleet" become anagrams of each other?

  1. A. 2
  2. B. 8
  3. C. 1
  4. D. 0

Correct answer: D. 0

Compare letter counts: each letter must appear equally often in both strings, so the total insertions is the sum of count differences. Using LCS or length differences measures other things.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic