Nice, i have noticed same pattern from basics tests but i didnt even try it.I over engineered it as much i could haha :O
This comment is hidden because it contains spoiler information about the solution
I rearranged and simplified the formula for sum of elements of arithmetic sequence, and this simple formula came out.
One tricky part was determining how many odd numbers should be used in the sum, but as I remember it was also represented by some arithmetic sequence.
Now I don't remember the exact steps I have taken but if you want to understand it, you should look at it as arithmetic sequences.
How does it work?
Why is the function name Xorf instead of Xor?
Excellent and concise solution!
In that case, nevermind ¯\_(ツ)_/¯
Random tests are useless for this kata - all possible values are tested
Needs random tests
Sample Test Cases need to be added; when writing a translation, try to keep it consistent with the original kata.
There are no tests that require uint64, so either the result should be uint or bigger tests should be added.
Needs random tests.
Looks like you need to add random tests.
The random tests are incorrect. The random string needs to be calculated within the loop.