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.
"the only thing that would actually meet that criteria is nested arrays." => Well, no. For instance, an array of string does the job just right.
One could also choose to represent a whole 2D matrix with just one string (i.e https://www.codewars.com/kata/586214e1ef065414220000a8 and other string input katas do exactly that). I'm not sure what makes you think something would be wrong.
Yeah I saw that after I posted the issue, but decided to leave it up because although this problem elects to ignore that it's called "matrix" rotation. To my understanding in programming the term matrix is not applied to one dimensional arrays, and outside of things like C# multi-dimensional arrays the only thing that would actually meet that criteria is nested arrays.
No:
This kata doesn't currently test for a scenario of nested arrays/lists. there should be tests akin to
(
[
[1,2,3],
[4,5,6].
[7,8,9],
],
[
[7,4,1],
[8,5,2],
[9,6,3],
]
),
.
Exactly, that was my point. This kumite needs new test inputs
Correct, this will return False if it is odd and True if it is even. I've seen some more complex mathematical methods to detect if it's a power of two with just simple arithmetic but what would probably be easiest is to import Math and do return False if math.log(n, 2)%1 else True
I think this checks if a number is odd, not if it's a power of two. For example,
12 % 2
is equal to0
, yieldingTrue
but12
is not a power of two.thank you ,this is good way