Pergunta de entrevista da empresa TA Digital (Australia)

Rotate a matrix such that it should be like this.