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.
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?
But for -6 -> -8 is expected and that is fine?
Edit:
I got it, thanks! :)
This comment is hidden because it contains spoiler information about the solution
Tbh took me a while to pass in 12s :D
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?