-3
I have a array of values:
values = [2, 7, 15, 11, 5]
I would like to take only the values that divide between them give rest '0' (return 15 and 5).
I’m getting it this way, but the code will read others arrays of numbers that are not divisible by 5, then each division would have to be made within the array, for each other.
values.select{|num| num % 5 == 0}
I would like to receive the same result but not using divisor number (5) in the case.
[15, 5]
what you already have of code?
– rLinhares
I resolved in the form below, after taking a look at the documentation, I made a loop nested to another.
– Jair Silva