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
This is my favorite solution so far since it thinks of an IP address, first and foremost, as just an alternate representation of a 32-bit integer where the answer to the kata is a simple subtraction.
Wish I'd remembered to think of the IP address as just a 32-bit integer as well. :)
I see where you're going with an OO solution, but since the only functionality that this class provides is (a) storage of an IP address as a 32-bit integer and (b) the subtraction of two 32-bit integers (two IP addresses), it's a bit over designed.
Ah, you're right - I misread the description. It's given as a Time in the Ruby example. My mistake. It's only given as a Date in JS/CoffeeScript.
This shouldn't work, since the kata says that the *_time variables are given as a Date, and the standard lib does not have a Date::to_i method. However, I see many other passing examples...weird.