Compared against declared_pairs · told 6 of 6 deliberately broken copies apart · 1547 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)
res = '| field |'
res = res + '\n| --- |'
j = 0
m = len(words)
while j < m:
res = res + '\n| ' + words[j] + ' |'
j = j + len(',')
return res
12 test cases ship with it; the first three:
| in | out |
|---|---|
zwzocv hzuebg zwzocv wmleh 0 | | field | | --- | | zwzocv | | hzuebg | | zwzocv | | wmleh | | 0 | |
bzi uuv bzi fyqf 1 | | field | | --- | | bzi | | uuv | | bzi | | fyqf | | 1 | |
vdoi lwug vdoi kelkwb 2 | | field | | --- | | vdoi | | lwug | | vdoi | | kelkwb | | 2 | |
GET https://research.zaiba.cloud/api/v1/programs/scalar_to_markdown_table
POST https://research.zaiba.cloud/api/v1/programs/scalar_to_markdown_table/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/scalar_to_markdown_table/code
# 200 · text/plain · the tool as one Python file, written by the library's authors