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.
Thank you very much, I have already tried these.
I was just curious if there was any way to properly submit my solution.
But really thank you!
You could comment out the 1e6 example test; if you can pass the smaller ones you know you need moar speed.
My attempt to run the test fails as it always times out.
I assume it's because n couldn't be more than a certain amount?
I am really sorry if the solution is just as obvious as it may seem, but I am quite a rookie in this whole coding field.
I would honestly appreciate any help!
Agreed...from reading the example I quickly assumed it ended at the third power. Thanks for looking into it.
OK, you're missing 32 = 25.
b
is not limited to 3. You could limit yourself to prime values ofb
, but you have time to do all of them; that's probably easier. Also, filtering an array of sizen
is never going to work forn
up to 1010. You'll need a major redesign.If you post which numbers you think are representable as powers, I can also look into it.
Thanks I'll look into it.
I get
[ 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100 ]
. That's 12 of 'em, so89
can't be correct.You might also get an off-by-one error by counting powers up to but not including
n
, and subtracting that fromn
. But that would be silly.I think you're wrong.
What numbers from the first 100 do you think are representable as ab ?
Note that there are fourth, fifth and even a sixth power below 100.
Tell me if I am wrong but I dont think the test results account for square and cube sharing the same numbers.
I get 89 instead of 88 for the first 100. cube and square share only one number under 100 which is 64. and accounts for the lost number.