Ad
  • Custom User Avatar

    In Dart, the random test do not use immutable lists as input, as a result if the solution alters the original list, the test will fail.

    In my case, since I was removing items from the list, the test expected the "correct" solution to be an empty list [].
    I believe this is because the expected solution is computed after the actual one has ran.

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

    merged, since there's almost nothing to do about that :/

  • Custom User Avatar

    PowerShell fork with upgrading to 7.2 version

  • Custom User Avatar

    F# fork with upgrade from 4.1 to 6.0, can invalidate all solutions due to changes of testing code (74 for now), so please review and approve (katafix helped)

  • Custom User Avatar

    fixed

  • Custom User Avatar

    Swift: although random tests are present, they're actually not called

  • Custom User Avatar

    fix merged

  • Custom User Avatar

    Elixir will print the following warning after running the tests:

    warning: missing parentheses for expression following "else:" keyword. Parentheses are required to solve ambiguity inside keywords.
    
    This error happens when you have function calls without parentheses inside keywords. For example:
    
        function(arg, one: nested_call a, b, c)
        function(arg, one: if expr, do: :this, else: :that)
    
    In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:
    
        function(arg, one: if(expr, do: :this, else: :that))
        function(arg, one: nested_call(a, b, c))
    
    Ambiguity found at:
      test/solution_test.exs:23
    
    warning: missing parentheses for expression following "do:" keyword. Parentheses are required to solve ambiguity inside keywords.
    
    This error happens when you have function calls without parentheses inside keywords. For example:
    
        function(arg, one: nested_call a, b, c)
        function(arg, one: if expr, do: :this, else: :that)
    
    In the examples above, we don't know if the arguments "b" and "c" apply to the function "function" or "nested_call". Or if the keywords "do" and "else" apply to the function "function" or "if". You can solve this by explicitly adding parentheses:
    
        function(arg, one: if(expr, do: :this, else: :that))
        function(arg, one: nested_call(a, b, c))
    
    Ambiguity found at:
      test/solution_test.exs:23
    
  • Custom User Avatar

    I think you meant when n is the divisor and 2n-1 is the bound and n is the solution, because your solution fails on exactly that case, not on the written one.

  • Custom User Avatar

    In this case, however, each row corresponds to its input, i.e. if the first input values are divisor = 2, bound = 7, then the first row of result table must have 6 as a res value.

    Sorting a table with just res values may validate incorrect solutions sometimes, because despite having different answers for each row, it can actually be sorted as well as the expected table so that they're equal.

    The solution is to add divisor and bound to the result table, BUT it will invalidate 2K+ solutions which work only with the one column...

  • Custom User Avatar

    Apparently that's because PostgreSQL returns the FLOOR() result as double precision value, therefore, res has double precision type as well.

    Why does that function works that way, I really dunno, because logically floored number is just the integer part, but at least the question on the error matter can be resolved

  • Custom User Avatar
  • Loading more items...