Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2518. Number of Great Partitions
Count the number of ways to assign each element to one of two ordered groups so both group sums are at least k (mod 1e9+7). Key trick: instead of enumerating partitions, subtract assignments where a group's sum < k by counting subsets with sum < k using a knapsack/subset-sum DP (k ≤ 1000).
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.