Compared against declared_pairs · told 12 of 12 deliberately broken copies apart · 1750 ms
def solve(s):
out = '| n |'
out = out + '\n| --- |'
i = 0
t = ''
d = 0
u = s + '\n'
while i < len(u):
c = u[i]
i = i + len(c)
if c >= '0' and c <= '9':
t = t + c
else:
if c == '-' and t == '':
t = '-'
else:
if c == '.' and t != '' and t != '-' and d == 0:
t = t + '.'
d = len('.')
else:
if t != '' and t != '-' and t != '.' and t != '-.':
out = out + '\n| ' + t + ' |'
t = ''
d = 0
return out
12 test cases ship with it; the first three:
| in | out |
|---|---|
82 -6 16 82 6.5 x6 82-16 0 | | n | | --- | | 82 | | -6 | | 16 | | 82 | | 6.5 | | 6 | | 82 | | 16 | | 0 | |
56 -5 23 56 5.5 x5 56-23 1 | | n | | --- | | 56 | | -5 | | 23 | | 56 | | 5.5 | | 5 | | 56 | | 23 | | 1 | |
87 -2 86 87 2.5 x2 87-86 2 | | n | | --- | | 87 | | -2 | | 86 | | 87 | | 2.5 | | 2 | | 87 | | 86 | | 2 | |
GET https://research.zaiba.cloud/api/v1/programs/numbers_to_markdown_table
POST https://research.zaiba.cloud/api/v1/programs/numbers_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/numbers_to_markdown_table/code
# 200 · text/plain · the tool as one Python file, written by the library's authors