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.
Hi,
The example you give:-
sort_by_perfsq([234, 61, 16, 441, 144, 728]) == [144, 441, 16, 61, 234, 728]
number of perfect squares: 2 2 1 0 0 0
suggests that a perfect square should only be counted once even if it comes from
2 or more sources. Hence 16 is counts 1, but 61 counts 0. If this is the case what are the
rules for counting or disregarding in such an example.
Also 234 counts 0, 324 variation being ignored. It seems the instructions in this kata are not
clear enough.
See above, this occurs when you print the integer value.
482 is correct:
I have an issue with one of the tests:
For (3, 4, 1001) my solution give 27 whereas your's says it should be 482.
A quick python check of (3**19683)%1001 gives 27, so I don't know who is correct
Difficult for a 7 kyu. Succeeded on my 3rd algorithm, after previous efforts timed out.
Without giving too much away I think the trick is to work backwards, starting at the answer.
I expect the more challenging version of this will be impossible.
as long as
long
Hey @ihatemaths - thanks for your lovely message, it made my afternoon reading it! I thought I was one of the older people on the site, but you have me beat.
My neighbor (79 years young) decided to take up triathlon last year and now I see him every other day in my town practicing his cycling - and I live in a mountain region! - so never say never about the maths learning ;)
Happy new year and I hope you have a great 2023
I think I've got as far as I can on this. I time out on the last test group. Still,
I've come a long way and learnt a lot which is the main thing. My solution is python, more
or less one-liner, I haven't enough maths to get the clever solution, and at 76, I'm passed
learning it. Nice kata, and thanks. I'll come back to it I ever any more inspiration.
This is another kata I will have to give up on due to inconsistancy of codewars' test harness.
The instructions state 'i' and 'j' should be treated as the same. However, sometimes the encryption
comes back with 'I', sometimes with 'J', apparently randomly. I don't suppose anyone will reply to this,
as is the norm when commenting on an old kata, so I'll move on, as it is impossible to arrive
at a solution that will satisfy the test harness. At least it wa an interesting challenge.
In the given example, where does 'qr' at the end of the split pairs in step 4 come from?
Looking through the posts for this kata, it seems the grouping split is not adequately defined. I think therefore I will not make an attempt at it. I don't want to waste my time. Either it should be corrected, or removed.
Please ignore my previous post. I see that the test script had got corrupted.
I can see what it should be.
Chris
Your test harness gives an error on the last test:-
File "/workspace/default/tests.py", line 8
test.assert_equals(upsidedown('100000','123456789000000),718650)00'
^
SyntaxError: '(' was never closed
Hi @ihatemaths (nice username!),
I copied your current solution locally, and performed a test with two inputs:
a=0, b=10 -> returns 3
(this is the test in the Description)a=0, b=11 -> returns 4
this is incorrect, because the kata expects 3 if I'm not mistaken. Note that here, going fromb=10 to 11
we have that11
is an upside down number.The description says: "For example,
solve(0,10) = 3
, because there are only 3 upside down numbers>= 0 and < 10
so as you can see here the upper limit is NOT inclusiveSo tl;dr, it seems your code is currently counting the upper range limit value, when it should not.
Loading more items...