This comment is hidden because it contains spoiler information about the solution
The kata specification assures us that the parameters are in range, so there's no point in checking.
Further, checking you are doing is insufficent and misleading. You check for too low, but not too high. And it's wrong. Given Past(-1, 1,0) will return 60000, but it's an invalid time. There is no correct answer. If you needed to check the range, it should be:
if (h <0 || h > 23)
throw new ArgumentOutOfRangeException("h", "Hour must be in range (0...23)");
He has defeated all challengers. He has not lost to anyone. That's a victory.
Why should he win if there are no dragons to fight?
Spilled coffee on the forward slash key and didn't know another way to divide by two. I was also unable to post questions... they all looked like sentences with no punctuation at the end. It was a rough day.
Division is the slowest of the basic arithmetic operations, and you do the same division TWICE? What's wrong one division with a simple ">=" ?
Why are we dragging floating point math into a simple integer calculation?
If there are zero dragons, he's still a hero, even if he has no bullets, which makes the first clause in the if() both unnecessary and conterproductive.
If there are zero dragons, he's still a hero, even if he has no bullets, which makes the second clause in the if() both unnecessary and conterproductive.
Why should he fail if the number of dragons is zero? That should be an easy win for him.
Your use of strings everywhere (without even a StringBuilder at all) will probably make this at least on orderof magnatute slower than almost any other here.
Look into the Char type.
Eeek! That's scary on so many levels...
What you are looking for is:
Hard-coding the ASCII code for space is sloppy. Better/clearly to just use a space: if (a[i] != ' ')
if (a[i] != ' ')
You add a special case for an empty string, but allow a null to go thru?
Ick, ick, ick
Why are you converting a perfectly good enum into an int?