8 kyu

Generate range of integers

16,883 of 26,577XxxX88

Description:

Implement the function generateRange which takes three arguments (start, stop, step) and returns the range of integers from start to stop (inclusive) in increments of step.

Examples

(1, 10, 1) -> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
(-10, 1, 1) -> [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1]
(1, 15, 20) -> [1]

Note

  • start < stop
  • step > 0
Algorithms

Stats:

CreatedSep 6, 2015
PublishedSep 6, 2015
Warriors Trained35666
Total Skips480
Total Code Submissions75926
Total Times Completed26577
JavaScript Completions16883
Elixir Completions240
C# Completions2168
Racket Completions45
Rust Completions683
C Completions613
Prolog Completions32
Ruby Completions650
Nim Completions36
Julia Completions48
Python Completions5628
NASM Completions16
CoffeeScript Completions13
Scala Completions21
Java Completions206
Total Stars290
% of votes with a positive feedback rating93% of 3175
Total "Very Satisfied" Votes2777
Total "Somewhat Satisfied" Votes358
Total "Not Satisfied" Votes40
Ad
Contributors
  • XxxX88 Avatar
  • jhoffner Avatar
  • alchemy Avatar
  • cris Avatar
  • Unnamed Avatar
  • Jotha Avatar
  • ad2Phnx Avatar
  • 10XL Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • Matteo.B Avatar
  • Madjosz Avatar
  • mitron6 Avatar
  • rowcased Avatar
  • metagn Avatar
  • monadius Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • stellartux Avatar
  • RobsonMoon Avatar
  • user8436785 Avatar
  • SergeySinyavskiy Avatar
  • dbregeon Avatar
  • KayleighWasTaken Avatar
Ad