Array From a Range of Numbers

Published by Werdna in

Create a function that returns an array of all the integers between two given numbers start and _end.

Examples

range_of_num(2, 4) ➞ [3]

range_of_num(5, 9) ➞ [6, 7, 8]

range_of_num(2, 11) ➞ [3, 4, 5, 6, 7, 8, 9, 10]

Notes

  • start will always be <= _end.
  • start and _end are NOT included in the final array.
  • If start == _end, return an empty array.
Watch a quick demo on how Edabit works.