0
seems to be a silly question, but how do I count the array values and show the fraction of existing positive, negative and zeros, for example: [1,3,0, -1] and returns [0.50,0.25,0.25]? I did a for and if, but still I continue with that doubt.
Thank you
Kd your code? post to try to improve it ;)
– rLinhares
Can you explain better what you want with examples? What is the relationship between these arrays?
– Sergio
@Sergio I have a function in which I will receive x array and in it I need to count the amount of positive, negative and 0 that it has, and with that return another array with the percentage of numbers, for example, numerosX([1, 2, 0, -1]) should return [0.5, 0.25, 0.25]because there are 50% positives, 25% zeroes, and 25% negatives.
– user139817