Available question text
Count the number of nonnegative integer triples (a,b,c) with a + b + c = n and 0 ≤ a,b,c ≤ limit. With n, limit up to 1e6, the task is to compute this count efficiently using combinatorics (stars-and-bars with inclusion–exclusion) rather than brute force.
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 2929. Distribute Candies Among Children II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source