Compared against declared_pairs · told 6 of 6 deliberately broken copies apart · 1440 ms
def solve(s):
out = ''
cur = ''
sep = ''
i = 0
u = s + ' '
while i < len(u):
ch = u[i]
i = i + len(ch)
if ch == ' ' or ch == '\n' or ch == '\t':
if cur != '':
out = out + sep + cur
sep = '\n'
cur = ''
else:
cur = cur + ch
return out
12 test cases ship with it; the first three:
| in | out |
|---|---|
casay cuy casay apscpz 0 | casay cuy casay apscpz 0 |
tfo leoz tfo zxdgwm 1 | tfo leoz tfo zxdgwm 1 |
vtwtcl ksmvg vtwtcl owynpl 2 | vtwtcl ksmvg vtwtcl owynpl 2 |
GET https://research.zaiba.cloud/api/v1/programs/words_to_lines
POST https://research.zaiba.cloud/api/v1/programs/words_to_lines/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/words_to_lines/code
# 200 · text/plain · the tool as one Python file, written by the library's authors