Pergunta de entrevista da empresa Genesys

Given a square matrix rotate it by 90° in the given direction.