#3643

Flip Square Submatrix Vertically

newbie · 265 · lc easy +19 · 72.9% accepted · 56 likes · top 83%

Description

Given an m x n integer matrix grid and integers x, y, k, flip the k x k square submatrix whose top-left corner is at row x, column y by reversing the vertical order of its rows. Return the updated matrix.

Code

1
2
3