Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3242. Design Neighbor Sum Service
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source