Citadel interview question

Similar to matrix rotation problem