Pergunta de entrevista da empresa Google

Write high level logic to rotate an array 56781234. Final output should be 12345678