Every problem is one JSON file in problems/ plus three reference solutions in
solutions/, one each in JavaScript, Python and Java. A problem is accepted only
when all three references pass every example and test. Write the solutions
independently: when they disagree, one of them (or a test) is wrong.
{
"id": "win-streak",
"title": "Win Streak",
"difficulty": "easy",
"tags": ["strings"],
"description": "Markdown shown to players.",
"function": {
"name": "longestWinStreak",
"pythonName": "longest_win_streak",
"params": [{ "name": "results", "type": "string" }],
"returns": "integer"
},
"compare": { "mode": "exact" },
"examples": [{ "args": ["WWLW"], "expected": 2 }],
"tests": [{ "args": [""], "expected": 0 }]
}
examples are shown to players. tests are run when they submit.compare.mode is exact, float (with optional tolerance) or unordered
(the returned list may be in any order).class Solution with a static method
named after function.name. The generated signature is in
starterCode.java, and imports at the top of the file are preserved.From backend/:
node arena/scripts/validate-problems.js --fill my-problem # fills missing "expected" from the JS reference
npm run validate:problems # every problem, all three languages
--fill only fills values that are missing. Review the filled values: the
Python and Java references must then agree with them.
Problems must be your own work. Do not copy statements or tests from other sites or from any private problem bank.
Everything in this repository is public, including tests, so a determined player could hard-code answers. A hosted instance that runs ranked battles should also load a private set of extra tests that is never published.