Tap here to switch tabs
Problem
Submissions

Problem: Determine the Minimum Sum of a k-avoiding Array

med
30 min
Try to solve the Determine the Minimum Sum of a k-avoiding Array problem.

Statement

You are given two positive integers, n and k.

An array of distinct positive integers is defined as 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.

Constraints:

  • 1≤1 \leq n, k ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Determine the Minimum Sum of a k-avoiding Array

med
30 min
Try to solve the Determine the Minimum Sum of a k-avoiding Array problem.

Statement

You are given two positive integers, n and k.

An array of distinct positive integers is defined as 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.

Constraints:

  • 1≤1 \leq n, k ≤50\leq 50