Flip Square Submatrix Vertically
You receive an m x n integer matrix grid , and three integers x , y , and k .
The integers x and y represent the row and column indices of the top-left corner of a square submatrix and the integer k represents the size (side length) of the square submatrix.
Your task is to flip the submatrix by reversing the order of its rows vertically.
Produce the updated matrix after applying the requested vertical flip.

Input: grid = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]] , x = 1, y = 0, k = 3
Output: [[1,2,3,4],[13,14,15,8],[9,10,11,12],[5,6,7,16]]
Explanation: For this case, the diagram above shows the grid before and after the transformation.

Input: grid = [[3,4,2,3],[2,3,4,2]], x = 0, y = 2, k = 2
Output: [[3,4,4,2],[2,3,2,3]]
Explanation: For this case, the diagram above shows the grid before and after the transformation.
Constraints
m == grid.lengthn == grid[i].length1 <= m, n <= 501 <= grid[i][j] <= 1000 <= x < m0 <= y < n1 <= k <= min(m - x, n - y)
Did this problem appear in one of your interviews?
Responses stay private.
