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 is that with
Random.Shared.Next(1, int.MaxValue)
, your tests have a very high chance to be mostly meaningless: they will generate many numbers which are very easy to solve, and very few interesting numbers, which are more difficult to solve. For example, out of 30 numbers you generated, approx. 15 of them will be even numbers, which are trivial to solve.Your tests are not great, because they do not generate interesting inputs. Your solution is apparently also not great, because it's not able to solve the interesting inputs :)
Well, I have some bad news: there seems to be ~1000 tests when you hit "Attempt".
The problem is that your solution is doing more work than it has to. Your
max
condition can be improved significantly :P