Ad
  • Custom User Avatar

    Thanks siebenschlaefer!
    only after your explanation I understood what task wants from me!

  • Default User Avatar

    Thanks for the explanation, siebenschlaefer. It was fairly straightforward once I understood what was needed.

  • Custom User Avatar

    You have a sequence of values, e.g. [value1, value2, value3, value4, value5, value6, value7, value8, value9] and a function (predicate) that takes one argument and returns true or false. If you'd call the function for each argument you might get something like [true, true, true, false, true, true, false, false, true]. If you remove all values from the sequence up until (but not including) the first one that evaluates to false, you get this: [value4, value5, value6, value7, value8, value9] (because predicate(value1), predicate(value2), and predicate(value3) are true).

    Your task: Write a function that takes a sequence and a predicate and returns a new sequence starting from the first element for which predicate(element) returns false.

  • Default User Avatar

    Me too, I am slow at programming, I even unlocked the solution and did not really understand!

  • Custom User Avatar

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

  • Custom User Avatar

    now see if you can manipulate the array sans loops :)

  • Custom User Avatar

    Please mark your comment as spoiler if it contains solution relevant information.