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.
Returning 0 but expected NaN in C#. There is no NaN for integers, only for floats.
If you expect a float to be returned, then why are the results being truncated anyways?
Sum all fibonnaci numbers less than the argument that are even
Had so much trouble until I realized that cases have overflowing arithmetic with 32-bit integers
This comment is hidden because it contains spoiler information about the solution
Try it with SIMD
TryGetValue is better suited for accessing with a key undetermined to be in a dictionary
It's a good thing I wrote "Fortunately, seemingly all value types provided by .NET implement their own .Equals method to avoid boxing. So do record structs"
The ValueType class that all structs implicitly inherit don't have a generic implementation so only the object base class' .Equals method is implemented, meaning you'll have to go through expensive boxing for a simple comparison. This can even involve reflection
See here https://source.dot.net/#System.Private.CoreLib/src/System/ValueType.cs
Fortunately, seemingly all value types provided by .NET implement their own .Equals method to avoid boxing. So do record structs
I'm surprised there aren't more BitOperations solutions. There are more big integer solutions than this that do the same thing
You could say the same about any language
This comment is hidden because it contains spoiler information about the solution
Not enough information and available information scattered everywhere. You say the first few robots will have an updated state and transition_rule will be used to update the states of all robots. The rest is left to assumption from the description. Confirming a state for the previous robot and returning that clearly isn't enough and there's nothing else to gather from the description. Find a finite set of states and transition rules? We're only given 3 optional states, immutable in Rust.
What I'm taking away from 80% of the description with the other 20% left up in the air is that this function is called over a collection of robots and the return value is what the target robot's new state is, with all robots being the correct state expected
TimeSpan also has a FromHours function so you don't have to multiply the distance by 3600
This comment is hidden because it contains spoiler information about the solution
Because brute force O(n^2) is better practice than a hashed O(n) solution
Loading more items...