I have an NxN matrix and I want to pick a specific part of this matrix and rotate that area by 90 degrees clockwise. I have to specify this rotation under these conditions:
- (a, b) position as upper left corner,
- (a + c, b + c) position as lower right corner, and
- whose side length is c + 1.
So, when I give a=2, b=3, and c=3, the output will be like this:

Code:
import numpy as np
N = int(input())
S = int(input())
arr = np.array(range(0,N*N))
arr.shape = N,N
for i in range(S):
a,b,c = [int(x) for x in input().split()]
arr[a:a+c+1,b:b+c+1] = np.rot90(arr[a:a+c+1,b:b+c+1], axes=(1,0))
print(arr);