Compared against declared_pairs · told 8 of 8 deliberately broken copies apart · 1596 ms
def solve(s):
out = ''
tok = ''
sep = ''
i = 0
u = s + ','
while i < len(u):
ch = u[i]
i = i + len(ch)
if ch == ',':
if tok != '':
num = 1
j = 0
while j < len(tok):
c2 = tok[j]
j = j + len(c2)
if c2 < '0' or c2 > '9':
num = 0
if num == 1:
out = out + sep + tok
sep = '\n'
tok = ''
else:
tok = tok + ch
return out
12 test cases ship with it; the first three:
| in | out |
|---|---|
kyl, bjmwb ,jdte,0 | 0 |
mymsn, yxdm ,afudsh,1 | 1 |
ujjid, abaznu ,zpregn,2 | 2 |
GET https://research.zaiba.cloud/api/v1/programs/csv_to_numbers
POST https://research.zaiba.cloud/api/v1/programs/csv_to_numbers/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/csv_to_numbers/code
# 200 · text/plain · the tool as one Python file, written by the library's authors