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.
This comment is hidden because it contains spoiler information about the solution
|b[i] - avg(a)|
meansabsolute value of ( b[i] - avg(a) )
. Otherwise, you can simply take the description at face value; there are no hidden meanings. Just follow the instructions. Don't read too much into it, there is no more than what's there.Why do you need tests?
It asks you only for syntax.
This is a puzzle. You're supposed to figure out what the riddle is.
The kth character of the final list of S(26).
So S(1) = a
S(2) = aba
S(3) = abacaba
etc
Until S(26) = abacaba...(some stuff)...abacaba
The 3rd character of S(26) would be a, for example, the 4th character c, the 8th character would be [whatever letter is next in the final string / list].
Hopefully this is not spoilery, and is helpful.
"there are two 1x1 rectangles and one 1x2 rectangle. So
2 + 1 = 3
."You need to count all rectangles of all possible dimensions.
@littlejuniebug,
Many thanks for the notification regarding the faulty description - "return the square of the sums of each item" indeed makes no sense whatsoever now that I have actually read it :p I've just edited that part of the Description to say "return the sum of the squares of each item" instead - feel free to let me know should you encounter any other Issues, description-related or otherwise.
As for your suggestion regarding stating the relevant Array methods in the Kata Description, I'm afraid that this Kata is designed such that the user is expected to search it up himself/herself and come to a working solution that passes all checks through trial and error.
Cheers,
donaldsebleung
This comment is hidden because it contains spoiler information about the solution
You were not accused:-)
@g964 She. :-) In general with ranking of katas that I have solved that were good katas and are awaiting moderator approval, I go with two out of three in terms of how the author ranked it, the average ranking, and the average power users ranking.
Thanks for your post! I don't think that this kata is about math - maybe more a bit about physics since it is rather about finding a good invariant.
You (not g964, others !) have to keep in mind, when you start a kata from g964, that you can encounter a problem that is more about mathematics than coding (sometimes ;) ). This one is of this kind. And this is an useful approach too because sometimes, pure coding is not the good way of doing things ! (but I concede that, when you just want to practice code or to play a bit with it, this not the type of kata you need... ;) )
@
g964
: maybe you should tag it withmahtematics
? And keep up the good work ! :)@megawatt and @littlejuniebug@gmail.com:
the moderator who approved the kata found the kata easy since he gave it a 7 kyu hence no need to explain more which would give the solution. Sorry...
look at matrix[0][0]. Its value is "0,1", if robot start at this point, robot will be transfer to matrix[0][1], the value of matrix[0][1] is "0,0", then the robot will be transfer back to matrix[0][0].
This is the example in description. There are 9 points in
matrix
. Your task is to count how many points: robot start at this point, afterk
times transfer can back to this point.Loading more items...