Ad
  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    For every tuple (a,b) there is a repeating pattern in the sequence...

  • Custom User Avatar

    (@chrono: yet another oversensitive user... ;) )

  • Custom User Avatar

    @RenierC QuothTheRaven42 was saying I'm passive-aggresive and blocked me, I don't know why. You can see my few interactions wth him: here, here, and here

  • Custom User Avatar

    @QuothTheRaven42 I'm not seeing passive aggressiveness, can you elaborate?

    Remember the Codewars community is global and we all have different backgrounds and speak different languages natively. So miscommunication happens sometimes. Please try assuming the best intent when communicating on Codewars.


    This suggestion got 8 upvotes so it's probably worth updating the description to clarify.

  • Custom User Avatar

    I don't understand why every response he makes is so passive-aggressive. You'd think he hates to responding to people how he acts.

  • Custom User Avatar

    You need to implement something what would work like equivalent of:

    • generate a series of primes, starting from 2, 3, 5...
    • "glue" these primes together into a string,
    • cut out and return a slice of this string, starting at position given with 1st parameter, and of length given as 2nd parameter

    So parameters given to your function are position and length of a fragment which you need to cut out from the string formed by concatenation of primes.

    Is it clearer now?

  • Custom User Avatar

    The whole array.

  • Custom User Avatar

    Your code is incorrect for inputs like this one:

    [ 7, 4, 11, -11, 39, 36, 10, -6, 37, -10, -32, 44, -26, -34, 43, 43 ]

    This is the error message:

    Expected: 155, instead got: 148

    You can see 155 is the right answer adding all the numbers.

  • Custom User Avatar

    If it is random, we can't help you, it'll be different every time, try using console.log() to print the input yourself, it'll appear above the test result.

  • Custom User Avatar

    Parsing from the left, 3 and 7 are before the second 5. This is the whole sentence:

    Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that add up to form the sum.

    This is what it means:

    10                   // no pair
    10, 5                // no pair adding to 10
    10, 5, 2             // no pair adding to 10
    10, 5, 2, 3          // no pair adding to 10
    10, 5, 2, 3, 7       // a pair adding to 10: 3 + 7, done