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 for your post!
Really nice Kata. It shows that prime number are cool and give us many funny exercises. Made in C++.
I've read here that instruction was written too poorly. From my point of view it was quite nice to read. I enjoy your Katas a lot.
Nice but very easy Kata. It shouldn't be 4 Kyu in my opinion. C++
Great Kata! A Stunning example which showing that even a very fast computer is too slow to execute unefficient algorithm.
It took me quite much time today, at the begining I was happy with my O(n) complexity but it still wasn't enough, I finally noticed something and solved that as author of Kata. Goodluck to everyone!
Don't mention it, we are all here to learn :)
[Like me, trying to be more precise with English: above it should have been "no number satisfies", ah!]
Thanks for your reply, adjusted my code a little after thinking it through a bit and got it right this time. Sorry again for the dumb question.
You return 2 arrays for no reason; plus when no number satisfy the condition, you should just return
[0,0,0]
.This comment is hidden because it contains spoiler information about the solution
Hi Steffen :) How are you doing?
Please have a look at my solution and tell me how's it? (I have tried code golfing)
I have many other C++-Katas, if you like nice katas. :-)
Thanx for your help to find this mistake.
:-)
Everything is correct now. Thx for help :)
Oh, sorry, there seems to be a mistake in the tests.
The maximum x should only be 50.
I fixed it and published again.
Please try again.
So now, I have no idea. Look at that:
Expected: [ 216, 75318, 3844615327538216960 ] Actual: [ 216, 75318, 0 ]
Output of n_Th_ product from my compiler when overrange: (400,4) try:
1
4
56
1344
45696
1827840
74941440
3147540480
135344240640
5955146588160
267981596467200
12327153437491200
579376211562086400
-9083429992438956032
-2366211860479606784
1351768050068094976
-5720565164189679616
953291545283395584
6289513508967022592
918459484194471936
3286065987677323264
5676641121023819776
2927224205990690816
4866418054851985408
-1231003047975452672
-7550733101152862208
-2292944088552439808
4150388663773036544
7360157224611610624
-2688358706470453248
-5118745596785590272
3860904294609846272
-435230682738851840
8937604566749282304
-7114702248826896384
-4666292163909255168
-278097276990128128
4170333254945079296
-2612087783874887680
2089670227099910144
4467570830351532032
4611686018427387904
-9223372036854775808
0
0
0
0
0
0
...
0
Read the last comment and the replies. :-)
The last basic test exceeds 32 Bit. So it should be no problem with long.
Or do you have a concrete problem in solving the kata?
Loading more items...