Available question text
Given an n×m grid, produce p where p[i][j] is the product of all grid elements except grid[i][j], taken modulo 12345. With up to 1e5 elements, the key is to output all values in linear time by precomputing total product and zero counts (or using prefix/suffix products), noting 12345 is not prime so modular inverses may not always apply.
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 2906. Construct Product Matrix
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source