Ad
  • Default User Avatar

    very nice problem!

  • Default User Avatar

    thanks mane u really helped my morale here

  • Custom User Avatar

    Ugh, I thought it would be more difficult. If you are stuck, catch my support!

  • Custom User Avatar

    Returning 0, as per stated in the description, involves 2 conditions:

    • being a valid sequence (numerical values only)
    • having NO missing numbers

    As I said before, an empty sequence is either considered:

    • valid AND missing some numbers (starting with 1) -> so it should return the missing number
      OR
    • not valid (having no numerical values at all) -> so it should return 1

    An empty sequence doesn't satisfy both conditions for returning 0.
    And 1 is the missing number because as stated in the descritpion:
    "Check if the elements are part of an ascending sequence of integers starting with 1".

  • Custom User Avatar

    an empty sequence is valid but missing 1
    In both cases, the return value should be 1, not 0.

    If the sequence is valid, the return value should be 0, not some missing value:

    "1 2 3 4" -> 0  (not 5)
    "1"       -> 0  (not 2)
    ""        -> 0  (not 1)
    
  • Default User Avatar

    Thanks, I passed!

  • Custom User Avatar

    Because these two behave very differently. Most of the challenges are intended to be run with Postgres.

  • Default User Avatar

    Ok, but why on SQlite simple query doesn't returns an error and on PostgreSQL returns?

  • Custom User Avatar

    You don't have to create a new table. You are supposed to write a SELECT query. I will clarify this in the solution setup.

  • Default User Avatar

    Hi everyone, there is a problem with table Numbers. Even simple query 'select * from Numbers' returns error

  • Default User Avatar

    now working :) after the reset! thx :)

  • Custom User Avatar

    Either copy your code and hit Reset button at the bottom, or simply click Attempt. I don't see how it wouldn't work, I ran it myself and it passed.

  • Default User Avatar

    No, i never touch the original test :/

  • Custom User Avatar

    But your current code passes all tests. Did you modify sample tests for this error to happen?

  • Default User Avatar

    yes also saw and i changed again. so now the name of the function is evenOrOdd.

    and the error:

    ReferenceError: even_or_odd is not defined
    at /home/codewarrior/index.js:12:10
    at /home/codewarrior/index.js:16:5
    at Object.handleError

    so i think this task is not difficult but i got some error :)

  • Loading more items...