That is beyond confusing... I'm sure this solution is good, clever and all that but it takes serious dedication to understand what's going on whatwith all the single-letter variable names and a variable "sorted" that's supposedly... not sorted?..
As I understand it, it's just how BitConverter works. It seems that whatever architecture CodeWars uses to run our code happens to be little-endian, and thus GetBytes() acts accordingly. See the documentation:
The order of bytes in the array returned by the GetBytes method depends on whether the computer architecture is little-endian or big-endian.
Do note that the Kata does implicitly describe the first octet being the left-most one (and, correspondingly, the most significant one).
That is beyond confusing... I'm sure this solution is good, clever and all that but it takes serious dedication to understand what's going on whatwith all the single-letter variable names and a variable "sorted" that's supposedly... not sorted?..
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It's just named "sorted", not that it's sorted
Please use spoiler flag next time, your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
As I understand it, it's just how BitConverter works. It seems that whatever architecture CodeWars uses to run our code happens to be little-endian, and thus GetBytes() acts accordingly. See the documentation:
The order of bytes in the array returned by the GetBytes method depends on whether the computer architecture is little-endian or big-endian.
Do note that the Kata does implicitly describe the first octet being the left-most one (and, correspondingly, the most significant one).