Ad
  • Custom User Avatar

    This is the best solution and if you have something to tell shut up please ;)

  • Custom User Avatar

    added in JavaScript. already existing in Haskell

  • Custom User Avatar
  • Custom User Avatar

    the real Clever is removing the const keyword from the arguments

  • Custom User Avatar

    The test is trying to use the + operator to add two integer arrays. You are responsible for implementing this functionality. The error message means that you haven't achieved that.

  • Custom User Avatar

    There might be an issue with the Kata's tests. I'm getting the following error after submission, although I don't have array + array operation.
    The stack trace is:

    An error occurred while loading ./spec/query_spec.rb.
    Failure/Error: actual = DB[actual].to_a if actual.is_a?(String)
    
    Sequel::DatabaseError:
      PG::UndefinedFunction: ERROR:  operator does not exist: integer[] + integer[]
      LINE 1: SELECT id, a, b, c, a + b AS "a + b", (a + b) + c AS "(a + b...
                                    ^
      HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:156:in `exec'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:156:in `block in execute_query'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:156:in `execute_query'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:144:in `block in execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:120:in `check_disconnect_errors'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:144:in `execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:500:in `_execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:318:in `block (2 levels) in execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:522:in `check_database_errors'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:318:in `block in execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/connection_pool/threaded.rb:92:in `hold'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/database/connecting.rb:269:in `synchronize'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:318:in `execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/dataset/actions.rb:1093:in `execute'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:614:in `fetch_rows'
    # /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/dataset/actions.rb:152:in `each'
    # ./spec/support/preloaded.rb:11:in `to_a'
    # ./spec/support/preloaded.rb:11:in `compare'
    # ./spec/query_spec.rb:18:in `block in <top (required)>'
    # ./spec/query_spec.rb:14:in `<top (required)>'
    # ------------------
    # --- Caused by: ---
    # PG::UndefinedFunction:
    #   ERROR:  operator does not exist: integer[] + integer[]
    #   LINE 1: SELECT id, a, b, c, a + b AS "a + b", (a + b) + c AS "(a + b...
    #                                 ^
    #   HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
    #   /usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:156:in `exec'
    No examples found.
    

    It seems for testing the column a + b AS "a + b" is used.

  • Custom User Avatar

    magic outside of hogwarts

  • Custom User Avatar

    is doesn't work the same way as == for non-primitive types.

  • Custom User Avatar

    added + chai assertions + removed non-integer inputs

  • Custom User Avatar
  • Custom User Avatar

    Thank you. Minifing was really challanging part!

  • Custom User Avatar

    Hm... The first simple tests run quickly. And then everything freezes, followed by a timeout. Is there something wrong with the tests?..

  • Custom User Avatar

    I solved this problem in Java. Now I have implemented the same algorithm line by line in Python. But the program does not pass the checks on large tests... And on some of them it works.

  • Custom User Avatar

    I don't understand what's happening in line 3. TT

  • Custom User Avatar

    That's not an issue I think. Many katas have 'bonus point' followups that are now actually required.

  • Loading more items...