Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
thanks that makes more sense
It's disabled and you've been warned in the description.
This comment is hidden because it contains spoiler information about the solution
Read the comments below - there are 7 years (!) of comments of people saying the exact same thing as you, with the exact same test case, and dozens of helpful replies explaining that
1074
is in fact the correct answer.See this comment for example:
The answer is 1074
The kata has been completed now 12,500 times - it's the correct answer.
If you counted manually, well then I'm afraid you need to improve your coding and your manual counting skills.
Please post in English.
Please use a spoiler flag as soon as you post code somewhere. Nobody should answer you: you are supposed to find the solution by yourself.
Kata hint is not a kata suggestion.
You are wrong.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
What's confusing in the description? Yours got rid of minimum and looks like any number that makes the sum a prime could be the answer.
Confused by the description? Here's how I rewrote it. Language is Ruby.
Define a method that takes an array of numbers, and returns a number, such that when added to the array, the sum of the array equals a prime number. The return value must be non-negative.
When I test n = 847043, it says Expected: 87043, instead got: 87443
The maximal number that I returned is larger. I delete the zero, then create a larger number than what the unit tests returns. It appears you can move around numbers. But looking at the provided test cases, you may not move around numbers.
It's not clever, it's a basic ternary operation!
Define a method that takes an array of numbers and returns the sum of its squares.
Loading more items...