ICM01 - Editorial

Problem Link:

Contest

Practice

Difficulty:

cakewalk

Explaination:

The answer array has to have N elements and K distinct elements.

Thus, choose K distinct elements to be from 1 to K and remaining N-K elements to be 1.

The sum of which is : (K*(K+1)/2)+N-K

Time Complexity: O(1)

Plz post question 3.