Company: Motive_26oct
Difficulty: medium
Lexicographical Merge Problem Description You are implementing your own programming language and you've decided to add support for merging strings. A typical merge function would take two strings s1 and s2 , and return the lexicographically smallest result that can be obtained by placing the symbols of s2 between the symbols of s1 in such a way that maintains the relative order of the characters in each string. Examples Example 1: Input: s1 = "super", s2 = "tower" Output: "stouperwer" Explanation: The result is formed by interleaving characters from s1 and s2 while maintaining their original relative order and ensuring the merged string is lexicographically smallest. The process for s1 = "super" and s2 = "tower" is as follows: Initially, the merged string is empty. We compare the first characters of the remaining parts of s1 ("super") and s2 ("tower"). 's' (from s1 ) vs 't' (from s2 ). 's' is smaller. Append 's'. Merged: "s". Remaining s1 : "uper", Remaining s2 : "tower". 'u' (from s1