about | help | code help+videos | done | prefs |
Write a method that "populates" an array of integers from 'first' to 'last' going up by 1 each time. For example, if you pass in 5 for 'first' and 7 for 'last' the method should return the array {5, 6, 7}. If 'first' and 'last' are the same number you return an array with just that number in it. If 'last' is less than 'first' return an empty array. Look at the test data for examples. feb5_2016_APSLHL_populateArray(4, 6) → [4, 5, 6] feb5_2016_APSLHL_populateArray(7, 14) → [7, 8, 9, 10, 11, 12, 13, 14] feb5_2016_APSLHL_populateArray(1, 5) → [1, 2, 3, 4, 5] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy