Determine the Minimum Sum of a k-avoiding Array at Infosys

Medium60.5% acceptance

This problem has 75.0% frequency at Infosys.

Problem Description

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`.

Read full problem and hints

Topics


More Infosys Questions

View all Infosys questions