← All problemsSign in

2834. Find the Minimum Possible Sum of a Beautiful Array

LeetCodeMathGreedyOpen on judge ↗

You are given positive integers n and target. An array nums is beautiful if it meets the following conditions: - nums.length == n. - nums consists of pairwise distinct positive integers. - There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target. Return the minimum possible sum that a beautiful array could have modulo 109 + 7. Exampl

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start