Some countries have integer numbers printed on the transport tickets, for example, in ex-USSR. The ticket is "happy" when the sum of the first half of digits equals to the second one. Then you should eat it and make a wish.
123456 and 111222 are not happy tickets
123123 and 123222 are the happy tickets
In theory, hash map structure should be very fast on retrieving by key operations, close to O(1) like for an array. A sorted map (keys are sorted) should be O(log2 N) instead. The following test checks the difference.
We will use one tester class per type of tested structure. The keys are string and are generated randomly in prepared array to avoid additional checks whether the key exists or not.
In the previous article "Crack C# namespaces in 30 seconds" I demonstrated how to make error having no idea about it. So you will have a lovely time in debugging. But in C# you're condemned to use using directive or your code will be unreadable with all these horrible specifiers