about | help | code help+videos | done | prefs |
When looking at all hailstone sequences from low to high, maxHail(low,high) will return the starting number that creates the longest sequence. In the case of a tie, use the lowest starting number. You should look at the hailLen() problem before working on this. You should use your solution from the hailLen() problem. ( http://codingbat.com/author/p264289 ) maxHail(1,17) looks at all the sequences and gives us 9, but we can start looking at 10, by saying: maxHail(10,17) which gives us 14. maxHailRange(1, 17) → 9 maxHailRange(10, 17) → 14 maxHailRange(1, 8) → 7 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy