Skip to content

Instantly share code, notes, and snippets.

@rpearce
Created August 27, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpearce/681ffc24aa8d1ba61f51 to your computer and use it in GitHub Desktop.
Save rpearce/681ffc24aa8d1ba61f51 to your computer and use it in GitHub Desktop.
Range Modulo Challenge
# Use Enumerable to select all of the multiples
# of 3 in any given Range and return them in an Array.
# Hint: Check out the modulo operator.
#
# The output should read like the following:
# => [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]
#
# The resources you can use:
# http://ruby-doc.org/core-2.2.3/Enumerable.html
# http://stackoverflow.com/a/3517240
range = 1..30
# your code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment