Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Iterate through all valid square submatrices of a specified size within a 2D array.
Calculate the sum of only the outer border elements for each submatrix.
Identify the maximum border sum, collect all unique values from frames that achieve it, and return their total.
What This Tests
2D Array traversal and coordinate indexing
Boundary extraction without double-counting corners
Dynamic state tracking for maximum values
Set operations for uniqueness filtering
Common Patterns
Sliding Window
Hashing
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
matrix =
frameSize =
Output
Expected