Kalepa interview question

Leetcode medium question about matrix transformation