Beta
Odd Square Patch
24saudiGuy
Description:
Task
Create a function that takes an array of numbers, and returns the size of the biggest square patch of odd numbers. See examples for a clearer picture.
Examples
odd_square_patch([
[1, 2, 4, 9],
[4, 5, 5, 7],
[3, 6, 1, 7]
]) ➞ 2
# The 2x2 square at the lower right
# ([5, 7] on the 2nd row, [1, 7] on the third).
odd_square_patch([[1, 2, 4, 9]]) ➞ 1
# An array with a single row can only have a square patch of
# maximum size 1x1 containing a single odd element.
odd_square_patch([[2, 4, 6]]) ➞ 0
Input Constraints
- Easy -> 0 <= rows, cols < 20
- Medium -> 20 <= rows, cols < 100
- Hard -> 100 <= rows, cols <= 200
Performance
Similar Kata:
Stats:
Created | Aug 19, 2023 |
Published | Aug 19, 2023 |
Warriors Trained | 27 |
Total Skips | 0 |
Total Code Submissions | 130 |
Total Times Completed | 24 |
Python Completions | 24 |
Total Stars | 2 |
% of votes with a positive feedback rating | 83% of 12 |
Total "Very Satisfied" Votes | 9 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |