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.
Why using KeyValuePari when you can use Tuple<> ?
Absolutely not a "best practice" because of the way Dictionary is used.
Since a while, .Net take care of the order of insertion, but it is not specify and can change at any time.
A dictionary is meaned to store a relation between keys and values, not the order of keys.
The usage of anonymous class or Tuple would be far better.
The rest is perfect.
func1 and func 2 are delegates, a type that represent a calling site (a method somewhere).
It's like pointer of function in C/C++, but delegates in C# posses more informations than that (the instance of the object for non static method, ...)
This feature is used in many scenario: Event manamgement, Linq (to object), ...
If compiler produce a binary and the binary works, that's clearly legal.
But, as you don't put parenthesis on a variable, it's better to use Invoke() to clarify the context.
ashame to forget about '\z' instead of '$'
Speed is not the reason of the necessity to use StringBuilder, it is a consequence.
When you concat 2 string, the system need to create a new array for the new string and copy all the bytes
So, your program will take twice the memory for the operation and copy again and again all the bytes to the new string.
StringBuilder use a bigger array and increased it's size when the limit is reach (like 2,4,8,16,32, ... x2 each times).
Each Append() copy only the bytes of the given string and do array resize time to times when size limit is reached, not each time.
eggplant is useless
As the array is never empty, a cool hack is to initialise 'small' with int.MaxValue
So you don't have to read twice the first value of 'args'. Your solution becomes compliant to more collection's types
This comment is hidden because it contains spoiler information about the solution
If you want more challenge, do it without using loops ;-)
This comment is hidden because it contains spoiler information about the solution
If you truly understand what is behind this code, you never would vote for Best practice nor Clever
A 'foreach' use an iterator and in this case, initialised on the first instance of 's'.
So, if value equal to "4t4" for exemple, the replacement will be executed twice, for each '4' detected.
And nothing will change to the looping context.
A chance that String is immutable in C# and you need to store a new version of it, because modifying a collection during an iteration on it will lead to an exception.
Really good use of Math.Sign() !
And good idea to join both value with negative worth values, that is not a common 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
Loading more items...