Ad
  • Custom User Avatar

    IMO, the problem is in the question. The question does not define "length" precisely.
    We have several kind of lengths in a Unicode string such as Code Unit count, Scalar Value count, Grapheme Cluster count, byte count.
    This answer is perfectly fine if the question was intended for byte count or Code Unit count.

  • Custom User Avatar

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