The bad thing is that the actual interview doesn't go such interactively
@aaravrajgroversbiggestfsn22773 жыл бұрын
Good
@aaravrajgroversbiggestfsn22773 жыл бұрын
👍
@rishikashnia12423 жыл бұрын
Print the common character , number of times it repeats in given array of strings (Using c#) void Calculate(string[] inp) { int[] a = new int[26]; for (int i = 0; i < inp[0].Length; i++) { a[inp[0][i] - 'a']++; } for (int i = 1; i < inp.Length; i++) { int[] b = new int[26]; for (int j = 0; j < inp[i].Length; j++) { b[inp[i][j] - 'a']++; } for (int j = 0; j < 26; j++) { if (a[j] > 0 && b[j] > 0) a[j] = a[j] + b[j]; else a[j] = 0; } } for (int i = 0; i < 26; i++) { for (int j = 0; j < a[i]; j++) { Console.Write(Convert.ToChar('a' + i)); } } }
@fetkamausam51323 жыл бұрын
you dont intialise with max take the min len string and count the each char like using dictionary