Ad
  • Custom User Avatar

    @hiyosilver - did you benchmark your code? I did, and the "naive" Min/Max solution is indeed faster. C# vectorizes the search, which makes it an order of magnitude faster than a linear search with a for loop, according to my benchmark.

  • Default User Avatar

    That's actually a much better idea, and should really be trivial to add.
    You could even I think quite easily add statistics like speed percentile for the given language. That would make unusually slow solutions stand out and lead people to question why that might be.

    That being said, I don't think this site sees a lot of development so this might be a fool's hope :P

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Feels like the "Best Practices" button should be restricted or disabled entirely, since a whole bunch of people will upvote anything that's crammed into a neat one-liner as "Best Practices" even if it's horrendously inefficient.
    Not that my code is exactly brilliant, but from the comments on a lot of these I get the feeling that many people are learning terrible habits.

  • Custom User Avatar

    TBH, IDK. Unless its in the constraints of the test it doesn't concern me. This isn't the real world, I'm not getting paid to do this. It's for fun. For all I know this is total crap, but it works :)

  • Custom User Avatar
  • Default User Avatar

    yeah... this was done badly, way too long ago. i'll redo it someday '-_-