Click4Ai

333.

Easy

In this problem, you will implement a function to randomly crop an image. **Example:** Suppose we have a 5x5 image and we want to crop a 3x3 sub-image. The function should return a 3x3 sub-image. **Constraints:** The cropped image should be a random 3x3 sub-image from the original 5x5 image.

Test Cases

Test Case 1
Input: [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20], [21, 22, 23, 24, 25]]
Expected: [[8, 9, 10], [13, 14, 15], [18, 19, 20]]
Test Case 2
Input: [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
Expected: [[5, 6], [8, 9], [11, 12]]
+ 3 hidden test cases