JPMorganChase Interview Question

it was a coding question regarding rotation of matrices