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.
It would be 6 Kyu if the user is enforced to implement an efficient algorithm.
Should be reclassified as 6 kyu (it is definitely not 7 kyu level kata)
Duplicate of this + this.
It's a hell of a kata for level seven | label it as level 6 seems to me more appropriate.
I had a great time solving this kata — appreciate your contribution.
This is not a level 7 Kata lol
Yup that does make sense. I mentioned to start from index 0 to indicate starting from left to right but have added your line as it makes it much clearer, thanks!
Heya! Fun kata, but I ran into a few problems.
Your reference solution has a left -> right bias in terms of parsing the string.
Eg.
peelPairs('12251', 6)
:221
. Total distance between the pair characters(1, 5)
is3
. This is the result the reference produces.122
. Total distance between the pair characters(1, 5)
is1
, they're adjacent. This is closer than the acceped solution, but will not be accepted.Given that the instructions state
they should be paired with the closest digit to them that sums to n
, I think you should clarify the instructions to includeclosest digit **to the right** of them that sums to n
.Hopefully that makes sense :D
.
Nice one.
But sample tests missed ;-)
EDIT:
And, in the initial code,
(str)
should be(str,n)
Thanks!
I didn't mean to make it repetitive as I thought I was testing different things (but maybe not).
I originally found the problem on Project Euler and did a quick search for it here but couldn't find it (clearly my search wasn't very thorough!).
The last bit was just meant to add an extra element to the problem-solving that I thought utilised different skills.
It gets a bit repetitive at the end. But otherwise great job.
That sounds like yet another attempt to prevent people saying it's an exact duplicate to a kata by being the exact duplicate of two katas combined.
Which means double unsatisfied. I wish I can vote twice.
May be 'cause there's yet a Difference of Squares kata ?
Okay, I understand the part about finding
E(X^2) - E(X)^2
.But why finding the square sum of digits of the result?
The last part doesn't really make any sense.