Ad
  • Default User Avatar

    So basically solution can be reduced to 2*(x1 * 2^0 + x2 * 2^1 + x3 * 2^2 ... xn * 2^n-1) + 1 or something similar, I see it now when I write it on paper, but why?
    Is that generally known or you came up with this because of this kata?

  • Default User Avatar

    But for -6 -> -8 is expected and that is fine?

    Edit:
    I got it, thanks! :)

  • Default User Avatar

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

  • Default User Avatar

    Tbh took me a while to pass in 12s :D

  • Default User Avatar

    For this part: The operator must call the selector-Func no more than once per element.
    What is considered element, is element considered pair, eg.:

    Calling Tuple.Create(0,1) and Tuple.Create(1,2) is considered double calling for element 1? Or element is considered as pair 0 1 (or 1 2)?

    ------ edit -----
    I figured out that it is pair but my test for iteration once over source was failing because I put

    if (source.Count() == 0) yield break;

    at begining of my second method that contained implementation, can someone explain why? I put that as protection line (not to even go to implementation if there are no elements) and it works fine only without that line. Imo I thing that it should't be an issue to have it or I am missing something?