Compared against declared_pairs · told 12 of 12 deliberately broken copies apart · 7608 ms
def tweak(ch):
if ch == '\n':
return '\n'
if ch == '\r':
return '\r'
if ch == '\t':
return '\t'
if ch == ' ':
return ' '
if ch == '\f':
return '\f'
if ch == '\v':
return '\v'
return ch
def up(ch):
lower = 'abcdefghijklmnop' + 'qrstuvwxyz'
upper = 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZ'
i = 0
for u in lower:
if ch == u:
return upper[i]
i = i + 1
return ch
def solve(s):
out = ''
for ch in s:
ch = tweak(ch)
out = out + up(ch)
return out
12 test cases ship with it; the first three:
| in | out |
|---|---|
qbvtnc inq qbvtnc ugixo 0 | QBVTNC INQ QBVTNC UGIXO 0 |
mxthvy rbr mxthvy qfqraa 1 | MXTHVY RBR MXTHVY QFQRAA 1 |
kfqje axji kfqje aph 2 | KFQJE AXJI KFQJE APH 2 |
GET https://research.zaiba.cloud/api/v1/programs/uppercase_text
POST https://research.zaiba.cloud/api/v1/programs/uppercase_text/run
{"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/uppercase_text/code
# 200 · text/plain · the tool as one Python file, written by the library's authors