Available question text
Split the given budget of prime factors into exponents e1+e2+... ≤ primeFactors to maximize the product e1*e2*... (each ei≥1), because the number of nice divisors equals that product. This reduces to an integer-partition maximization solved greedily by using as many 3's as possible (adjusting for a remainder 1 by using two 2's), and returning the product mod 1e9+7.
Related questions
Continue with questions that share topics or the same question type.
- Count Number of Nice Subarrays
Coding · Array · Hash Table · Math
- Maximize Number of Subsequences in a String
Coding
- Maximize the Number of Partitions After Operations
Coding
- Maximize the Number of Target Nodes After Connecting Trees I
Coding
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 1808. Maximize Number of Nice Divisors
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source