Ad
  • Custom User Avatar

    For those confused (as I was):

    • apparently, if the a contains repeated numbers, the squares must be repeated in b, so no sets (Python);
    • you must double check for various types, as input can be not only empty list, but also null.
      Not sure if these are considered spoilers, imo, no.

    All in all, a poorly worded task. This is good training for client-supplied task descriptions.

  • Custom User Avatar

    I thought about their lengths, the wording of the task is still not self-evident. A poorly worded task.

  • Custom User Avatar

    Unlike a number of other solutions, we quit evaluating list as soon as we see that it has both increasing and decreasing sequences, which means it is unordered. Not to speak of solutions, which go through the same list multiple times(!)

    This should improve timing for larger lists.