Square-Neighborhood Image Blur
Updated
Problem statement
For each grayscale pixel, consider all other in-bounds cells within row and column distance radius. Floor the neighbor mean, then floor the average of that mean and the original pixel. Preserve a pixel with no neighbors.
Return a new matrix using only original-image values for every calculation.
Function
blurImage(image: int[][], radius: int) → int[][]Examples
Example 1
image = [[9,6],[3,0]]radius = 1return = [[6,5],[4,3]]Moved or new
Each pixel sees the other three cells.
Example 2
image = [[7]]radius = 0return = [[7]]The only pixel has no neighbor.
Constraints
1 <= rows,columns <= 5000 <= pixel <= 2550 <= radius <= 500
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Split a Matrix Into Four Partitions by Average (Forward Deployed Engineer)Boston Consulting Group · OA
- Leaves Remaining After Wind GustsOpenAI · OA
- Shortest Path Around Rectangular ObstaclesDRW · OA
- Sub-matrix SumsIMC Trading · OA
- Largest Sub-GridMathWorks · OA
- Maximum Trailing Zeros on a Path with at Most One TurnMarshall Wace · OA
- Count L-Shaped PlotsUber · OA
- Matrix Region SumRippling · OA · ONSITE INTERVIEW
- Largest Square Sub-Grid Within a Sum LimitC3.ai · OA
- Find Minimum Time to Create Beautiful CanvasAmazon · OA