Given two strings, A and B, create a bigger string made of the first char of A, the first char of B, the second char of A, the second char of B, and so on. Any le
I used Merge sort approach to solve this problem. First I converted both the strings into their respective character arrays and then merged both the arrays and converted the array back to a string. You can find my code below,I have tested the code and it is working. Let me know if you have any questions..
public String merge(String leftStr, String rightStr) {
char[]left = leftStr.toCharArray();
char[]right = rightStr.toCharArray();
int nL = left.length;
int nR= right.length;
char[] mergeArr= new char[nL+nR];
int i=0,j=0,k=0;
int temp =0;
while(i