Блог пользователя M4A1

Автор M4A1, 4 года назад, По-английски

The key difference between this problem and the usual problem is an extra operation of swapping a character of one string with another. So we have 3 operations:

  1. Insert.
  2. Delete.
  3. Swap.

We can solve this problem by first resolving all the swap operations that we can perform and in the new strings, the difference in frequency of a character present in the both the strings is <= 1. But resolving all the swap operations will introduce a lot of conditioning for odd diff, even diff, mod>1 etc.

So can we solve this problem using a more simpler approach than rigorous if else?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится