Compared against declared_pairs · told 7 of 7 deliberately broken copies apart · 1625 ms
def solve(s):
words = []
cur = ''
i = 0
text = s + ' '
n = len(text)
while i < n:
ch = text[i]
if ch == ' ' or ch == '\n' or ch == '\t':
if len(cur) > 0:
words = words + [cur]
cur = ''
else:
cur = cur + ch
i = i + len(ch)
out = ''
j = 0
m = len(words)
while j < m:
if j > 0:
out = out + ','
out = out + words[j]
j = j + len(',')
return out
12 test cases ship with it; the first three:
| in | out |
|---|---|
nqbi drpfgt nqbi petpj 0 | nqbi,drpfgt,nqbi,petpj,0 |
awka pmcacd awka eck 1 | awka,pmcacd,awka,eck,1 |
fkag zhakx fkag lbsmdf 2 | fkag,zhakx,fkag,lbsmdf,2 |
GET https://research.zaiba.cloud/api/v1/programs/scalar_to_csv
POST https://research.zaiba.cloud/api/v1/programs/scalar_to_csv/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/scalar_to_csv/code
# 200 · text/plain · the tool as one Python file, written by the library's authors