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.
The problem here is that the line
strReturn = bitCurrent + strReturn;
is grossly inefficent. (It first creates a string out of the int, then concatenates it with the existing string, creating yet another string. I'd guess about 90% of the execution time is this routine would be on just that line.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
strings are an IEnumerable. The ToCharArray() is unnecessary.
What makes you think the Replace() would leave spaces on the start or end?
It's not redundant, just bad form. input[i] is a char, " " is a string. The line should be "if (input[i] == ' ')" or better "if (Char.IsWhiteSpace(input[i]))"
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice to preallocate the StringBuilder, but why are you dragging floating point into the calculation? The result has to be an integer, so you might as well, do everything in integer math.
Loading more items...