Commit 7a976c15 authored by Tom Niget's avatar Tom Niget

Fix find_indices to support UTF-8 characters

parent 5574219b
import sys
import math
def g():
def gàé():
return 1,2,3
if __name__ == "__main__":
if True:
a, b, c = g()
\ No newline at end of file
a, b = gàé() # abc
\ No newline at end of file
......@@ -148,8 +148,8 @@ def find_indices(s, indices: list[int]) -> list[int]:
except StopIteration:
break
j += len(s[i].encode("utf-8"))
i += 1
j += 1
assert len(results) == len(indices), (results, indices, s)
return sorted(list(results))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment