samedi 16 novembre 2019

Required code for the given problem statement

There are 'n' coins each having a value ranging from 1 to 100.

Input : n value of each coin

Sample Input:

3
2 1 2

Output should be the minimum number of coins that I have to take so that the sum of value of coins taken is STRICTLY greater than the sum of values of coins left.

Sample output : 2 // as 2+2 > 1

What is a simple working code for this problem?

Aucun commentaire:

Enregistrer un commentaire