session2/challenge/5_array.rb
# Write a function named mod_three which takes an array of numbers,
# and return a new array consisting of their remainder when divided by three.
# Exclude any numbers which are actually dividible by three.
#
# EXAMPLES:
# mod_three [0]  # => []
# mod_three [1]  # => [1]
# mod_three [2]  # => [2]
# mod_three [3]  # => []
# mod_three [4]  # => [1]
# mod_three [5]  # => [2]
# mod_three [6]  # => []
# mod_three [7]  # => [1]
#
# mod_three [0,1,2,3,4,5,6,7] # => [1, 2, 1, 2, 1]
Write a function named mod_three which takes an array of numbers,
and return a new array consisting of their remainder when divided by three.
Exclude any numbers which are actually dividible by three.




Write a function named mod_three which takes an array of numbers and return a new array consisting of their remainder when divided by three . Exclude any numbers which are actually dividible by three .
def mod_three(array)
  out = []
    array.each{|x|out << x % 3 if x % 3 != 0}
  out
end
def mod_three ( array ) out = [ ] array . each { | x | out << x % 3 if x % 3 != 0 } out end
Write a function named mod_three which takes an array of numbers,
and return a new array consisting of their remainder when divided by three.
Write a function named mod_three which takes an array of numbers and return a new array consisting of their remainder when divided by three .
array