Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Random N-numbers sum which is equal to 0

Write a function that as an argument gets the integer N (1 < N < 100).

This function is to return an array that contains unique N random numbers in the range -100 to 100, and besides that the sum of these numbers must always go to 0.

For example, for N = 4 array [-1, -2, 0, 3]


Enjoy