Skip to content

Instantly share code, notes, and snippets.

@nfedyashev
Created October 24, 2020 05:24
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 nfedyashev/4d52739680fcd61290424800d3a07216 to your computer and use it in GitHub Desktop.
Save nfedyashev/4d52739680fcd61290424800d3a07216 to your computer and use it in GitHub Desktop.
The simplest implementation might look like this:
<!-- language: lang-ruby -->
class ArrayUtils
def self.multiplos(num, step)
step.step(num * step, step).to_a
end
end
but you may need to add some additional checks for input arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment