Pergunta de entrevista da empresa Coding Ninjas

oops , two coding problems one from array another from string