Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3242. Design Neighbor Sum Service
Given an n×n grid of distinct values, implement a class that answers queries returning the sum of either orthogonally adjacent (top/left/right/bottom) or diagonal neighbors of a given value. Because values are unique and there can be many queries, precomputing a value→(row,col) mapping for O(1) lookups is expected.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.