1. Reverse character array without affecting special character in single loop. 2. given 2 character array S1 , S2 and 1 empty array S3. Populate S 3by interleaving character from S1 and S2
Anonym
public class demo2 { public static void main(String[] args) { int a[] = new int[] {3,2,2,2,2,2,2,2,2,2,2}; int a1[] = new int[] {22,99,34,35,56,78}; int a2[] = new int[a.length+a1.length]; int n=a.length,a3[]=null; if(a1.length!=a.length) { a3 = a.length>a1.length?a:a1; n = a.length>a1.length?a1.length:a.length; } int i=0,j=0,k=0; for(i=0;i