Pergunta de entrevista da empresa Cognizant

write a program to find a character with maximum appearance in a String

Resposta da entrevista

Sigiloso

18 de abr. de 2022

// Java program to output the maximum occurring character // in a string public class GFG { static final int ASCII_SIZE = 256; static char getMaxOccurringChar(String str) { // Create array to keep the count of individual // characters and initialize the array as 0 int count[] = new int[ASCII_SIZE]; // Construct character count array from the input // string. int len = str.length(); for (int i=0; i