Available question text
Given two arrays where each 0 can be replaced by any positive integer, find the smallest possible equal sum you can make their totals both reach (or return -1 if impossible). The core challenge is a numeric feasibility check using each array's current sum and count of zeros: you need an S ≥ max(sum1+zeros1, sum2+zeros2) (and if an array has no zeros its sum is fixed to S) — return the minimal such S or -1.
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 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source