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 does not work correctly for negative numbers.
Standard Math object:
Math.floor(-1.1) === -2
This implementation:
Math.floor(-1.1) === -1
This comment is hidden because it contains spoiler information about the solution
If there are two disconnected areas with the same letter, are they considered one territory or two distinct territories?
Consider for example the string
ABA
. Do the two As form two separate territories or one discontinuous territory?Also please note that there is a typo in the description. "chese board" > "chessboard".
This comment is hidden because it contains spoiler information about the solution
I created a fork with verbose comments to explain what is going on in this solution.
I hope I got it right...
Your clever solutions are a bit difficult to read... :-)
I created a fork of your solution with unnecessarily verbose comments to explain it to other warriors.
I hope I got the comments right.
Sorry for spamming by posting the same solution three times with only very little changes. (I just updated a misleading name of a variable here.)
I wanted to delete my previous submissions but it does not seem to be possible.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I used a Date object to convert the number of minutes to a properly formatted time string.
The Date constructor takes the number of milliseconds since the start of the epoch, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#Parameters
Oh, sorry, never mind then, I missed it.
This solution only works for numbers smaller than Number.MAX_SAFE_INTEGER. Since larger numbers are being tested, this solution passed in my first attempt just by sheer luck.
JavaScript version:
I think that the fact that tests include numbers larger than
Number.MAX_SAFE_INTEGER
should be mentioned in kata description.Very nice kata. I would suggest clarifying the order of coordinates in the kata description though because it differs from the standard order used in geography.
This kata expects the result as
[long, lat]
while the usual order used in geography is[lat, long]
.Failed test results only print "Value is not what was expected" and it seems impossible to use
console.log
to get a picture of what is actually being tested.Loading more items...