-1
I have the following question:
We need a function more less that takes an array and returns another with the following three numbers:
in the first position, the fraction of numbers that are positive in second position, the fraction of numbers that are zero at the last position, the fraction of numbers that are negative For example, more([1, 2, 0, -1]) should return [0.5, 0.25, 0.25], because there are 50% positives, 25% zeros, and 25% negatives.
TIP Some questions that could help: How could I pass an array and ask each element if it is positive, negative or zero? How could I account for the elements? How to build the resulting array with these values?
Welcome to Stackoverflow in English. I edited your question to remove the greetings as we usually keep the text as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the [chat]. If you have questions about the operation, rules and procedures of the site visit the [meta] :)
– Sorack