Hi everyone,

I was asked this question recently in an interview: Given two strings of
unequal length, you have to pad the smaller string (either at the beginning
or the end or both, no insertions allowed) with any character you want. The
idea is to minimize the index-wise non-similar elements in both the strings.

Example:
abc
cadbch

The character we want should be:

**abc*, such that the difference is just one(b and c are same for both
strings in this position). I only found a solution with O(mn) complexity.
Anybody can suggest any optimizations?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.

Reply via email to