Pregunta de entrevista de Publicis Sapient

java OOP, SQL, algorithm question with string manipulation