You are viewing a single comment's thread. Return to all comments →
this is my answer in Javascript :
let positives = 0 let negatives = 0 let zero = 0 arr.map( e => { e == 0 ? zero++ : (e > 0 ? positives++ : negatives++) }) console.log((positives / arr.length).toFixed(6)) console.log((negatives / arr.length).toFixed(6)) console.log((zero / arr.length).toFixed(6))
Plus Minus
You are viewing a single comment's thread. Return to all comments →
this is my answer in Javascript :