Pergunta de entrevista da empresa Oracle

How split method works? is related how to solve the algorithm.