2829. Determine the Minimum Sum of a k-avoiding Array
Problem Statement
You are given two integers, n
and k
.
An array of distinct positive integers is called a k-avoiding array if there does not exist any pair of distinct elements that sum to k
.
Return the minimum possible sum of a k-avoiding array of length n
.
Example 1:
Example 2:
Constraints:
1 <= n, k <= 50
Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Last updated