Ad
  • Custom User Avatar
    1. You need to check if each item in the list in a valid string (x.length > 0). Print the list to see what I mean.
    2. Use .append instead of +=
  • Custom User Avatar

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

  • Custom User Avatar

    Why did that take considerable time? n just needs to be a positive number, so simply "if n: do task else: return 0"