Ad
  • Custom User Avatar

    10.0.0.0 is not a valid address, it is a network address.

  • Custom User Avatar

    The first is inclusive, and the last is exclusive.
    Description: "including the first one, excluding the last one"
    So it's 50

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks for the complements! I actually use the IPAddress class for work fairly regularly. Codewars is where I tend to write rediculous one liner linq answers just for fun.

    Just one thing: when I cast your method on start = "10.0.0.0" and end = "10.0.0.50" it returns 50 but should be 51. From 0 to 50 you have 51 adresses to choose ;) so just add 1 to it somehow

    The Kata description says "returns the number of addresses between them (including the first one, excluding the last one)"
    That is why 50 is the correct answer.

  • Custom User Avatar

    From description:

    (including the first one, excluding the last one).

    So 0 counts, but 50 doesn't. 50 addresses seems correct.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Exactly this part is meant to be the main point of the kata, and I consider getting to this conclusion to have the most educational effect. I think it's worth for the users to spend some time to get to this by themselves.

    I am going to mark your post as spoiler, so others do not miss the fun of getting to the solution :)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution