Shortest Common SuperSequence 【O(M*N) time complexity】

Given two strings X and Y, the supersequence of string X and Y is such a string Z that both X and Y is subsequence of Z. in other words shortest supersequence of X and Y is smallest possible string Z such that all the alphabets of both the strings occurs in Z and in same order as of the original string. Let's understand it with an example:


This is a companion discussion topic for the original entry at http://iq.opengenus.org/shortest-common-supersequence/