Search
⌘K

Leetcode 2834. Find the Minimum Possible Sum of a Beautiful Array

Choose n distinct positive integers with no two summing to target so that their total is minimized, and return that sum modulo 1e9+7. The core challenge is to greedily pick the smallest allowed integers while avoiding complementary pairs (x, target−x) and handling very large n (up to 1e9) via arithmetic counting instead of simulation.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.