Ad
  • Custom User Avatar

    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 :)

  • Custom User Avatar

    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