about | help | code help+videos | done | prefs |
Write a recursive method that returns the number in the 'pos' position in a sequence of numbers. The sequence is generated using pos1 and pos2 as the first and second numbers in the sequence. To get the next number in the sequence, you always add the two previous numbers. For example, if pos1=1 and pos2=1, the sequence is the Fibonacci numbers: 1,1,2,3,5,8,13, etc. So moveItDown(1,1,7) returns 13 because that is the number in position 7 of that sequence. moveItDown(202, 101, 3) → 303 moveItDown(202, 101, 11) → 12423 moveItDown(1, 1, 7) → 13 ...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: 310
Copyright Nick Parlante 2017 - privacy