about | help | code help+videos | done | prefs |
Write a RECURSIVE method that returns a string showing all the numbers from 0 up to and (possibly) including 'maxNum' with a comma in between each number. However, you are not including ALL the numbers from 0 up to 'numMax' because you are skipping by 'skip', then 2*'skip', then 3*'skip', etc. You may or may not include 'maxNum' depending on how it lands. Look at the test data and make sure you understand when the results are the way they are. Your solution MUST be recursive. You may assume that 'num' will be non-negative. For example, if 'num' was 5 you would return "0,1,2,3,4,5". Look at the test data for other examples. numListSkip(0, 1) → "0" numListSkip(1, 1) → "0,1" numListSkip(10, 2) → "0,2,6" ...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: 340
Copyright Nick Parlante 2017 - privacy