Pregunta de entrevista de GlobalLogic

Java coding with occurrence of character