Ad
  • Custom User Avatar

    Hey @hobovsky 👋
    Just wanted to check in and ask how long the "Awaiting approval" phase usually takes/lasts?

  • Custom User Avatar

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

  • Custom User Avatar

    Why are we returning only the first gear rather than a full solution, does that make the problem easier in some way?

  • Custom User Avatar

    There is only a single real edge case in the hidden tests, and it's quite literally an edge case:
    The highest possible input as per constraints: [1, 10000]
    Hidden or not, this test should always pass if all the other cases work as well, without special attention to this specific case (unless the general implementation is wrong, in which case other tests from the random suite will fail too)
    I'll add that to the description

  • Custom User Avatar

    Oh boy, why hide edge cases in "hidden" tests ..

    The sample tests should be pretty straight forward. The hidden tests include some edge cases and then randomly generated arrays for valid setups and invalid setups.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Tests should most probably set chai.config.truncateThreshold = 0 to avoid truncation of arrays in assertion messages.

  • Custom User Avatar
    Fixed samples (advanced)
        expected [ -1, -1 ] to deeply equal [ 12, 1 ]
      Completed in 3ms
    Randomised property tests
        Wrong answer for pegs [4, 509]: expected [ -1, -1 ] to deeply equal [ 1010, 3 ]
    

    Random tests report inputs of failed cases, but fixed tests do not.

  • Custom User Avatar

    Done, cool.

  • Custom User Avatar

    My hardcoded solution does not pass anymore, so this issue is apparently fixed.

  • Custom User Avatar

    should be resolved now

  • Custom User Avatar

    Ill try to fix those asap. Thanks for the feedback. Writing tests was never my strong suite 😅

  • Custom User Avatar
  • Custom User Avatar
    • Tests should use Chai assertions instead of compat module for the obsolete, homegrown assertions library.
    • Tests should verify the returned item before accessing its contents. Currently, returning undefined causes tests to crash.
    • Tests for "should not return [-1, -1] for some valid random arrays" pass even if I return a totally wrong answer.
    • Tests are susceptible to mutation of input: if my solution modifies pegs, the modified array is presented as input in failure messages. Tests should ensure that the input array is not modified by user solution.