Ad
  • Custom User Avatar

    you can use list slices

  • Default User Avatar

    That return actually outside the loop, because he didnt add {}. The loop without curly bracket only take one action.

  • Custom User Avatar

    No, you have to return n numbers of the sequence, counting the ones of the signature too. So, the signature always has 3 elements, but if n is 0, you return an empty array/list, when n is 1, the first element of the signature, etc. I hope it is clearer now.

  • Custom User Avatar

    You're confused there, signature always has 3 numbers:

    Signature will always contain 3 numbers; n will always be a non-negative number; if n == 0, then return an empty array (except in C return NULL) and be ready for anything else which is not clearly specified ;)

    n can be less than 3.