Find Minimum Operations Required To Convert String1 To String2

Write a program to find out the minimum number of operations required to convert source string to target string.
To convert source string to target string, only insert and delete character operation are allowed.
For eg:

  • Source = “ABCD”, Target = “ACDB” – Operations = 2 (Delete B and insert B at end)
  • Source = “ABCDEF”, Taget = “ACDEF” – Operations = 1 (Delete B)
(more…)
Find Minimum Operations Required To Convert String1 To String2 Read More

Replace Character of String With Another Character N Place Down the Alphabet

Given a string ‘s’ and a number ‘n’, write a function that returns a string with each character in s replaced with another character that is ‘n’ positions down the alphabet.

If n is 1, A is replaced with B, B is replaced with C, Z is replaced with A and so on.

If n is 2, A is replaced with C, B is replaced with D, Z is replaced with B and so on.

(more…)
Replace Character of String With Another Character N Place Down the Alphabet Read More