Ad
  • Default User Avatar

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

  • Custom User Avatar

    This is tricky.

    new String will never be interned if not interned explicitly, because it is, well, new-ed. So it's always new in the beginning, you will not get an interned instance by calling new (it can be interned later, but details are not simple). But. C# has the concept of operator overloading (unlike Java), and it overloads the operator == for many value types, including string. That's why str1 == str2 performs value equality check, and not a reference equality check. new String("") == "" will always return true. But. The example you showed does not perform a string equality check. It compares an object with a string, so the overloaded String.operator == does not kick in. The comparison is a reference equality check, and, in this case, it will return true only when checking equality of interned string instances.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    In this kata we have the example:
    "var helper = new PaginationHelper(new List{'a', 'b', 'c', 'd', 'e', 'f'}, 4);
    helper.PageCount; // should == 2
    helper.ItemCount; // should == 6
    helper.PageItemCount(0); // should == 4"

    But you can't use it like this:
    helper.PageCount; // should == 2
    helper.ItemCount; // should == 6

    Those are props - not a method!

    And this kata is stupid. I wrote my code - and pass all 17 test and then pass 63 from 65 when was trying to submit. So - i rewrite it twice - but the same result - 63 tests were good. In my ps i couldn't reproduce any errors - so - i picked up this solution.

    This is the first time i use someone's solution - but thit kata is so lame!
    I know how to solve it - but they said - that it didn't pass some misterrious tests - i don't even know what kind of tests...

    So, i got 63 from 65 =)

    With love =)

  • Default User Avatar

    I like the way you calculated years and so on.

  • Custom User Avatar

    I did the solution with over 40 lines of code and time complexity was still O(N log (n) ), so looking at this solution is embarrasing

  • Custom User Avatar

    Great minds think alike! This is pretty much identical to what I came up with!

  • Custom User Avatar
  • Default User Avatar