about | help | code help+videos | done | prefs |
Write a method that returns a string of all the prime numbers up to 'max'. Each prime number has a space after it, including the last one, so the string must end in a space. The value of 'max' will be between 2 and 1000. Part of this challenge is to write a program that does not use more memory than CodingBat allows and also does not time out. sep27_2016_BONUS_primesBelow(2) → "2 " sep27_2016_BONUS_primesBelow(4) → "2 3 " sep27_2016_BONUS_primesBelow(5) → "2 3 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