8 kyu

Generate range of integers

16,919 of 26,700XxxX88

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 Trained35799
Total Skips481
Total Code Submissions76195
Total Times Completed26700
JavaScript Completions16919
Elixir Completions240
C# Completions2176
Racket Completions46
Rust Completions687
C Completions617
Prolog Completions33
Ruby Completions651
Nim Completions36
Julia Completions48
Python Completions5688
NASM Completions16
CoffeeScript Completions13
Scala Completions22
Java Completions226
Total Stars291
% of votes with a positive feedback rating93% of 3184
Total "Very Satisfied" Votes2785
Total "Somewhat Satisfied" Votes359
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