Skip to main content

Code Arena

Code Arena is a set of timed programming problems you solve in the browser. You write the code, run it, and submit it against a set of test cases — some you can see, some you can't. Solve every case and you earn Zeal and Jolt, the platform's two kinds of points.

By the end of this page you will know how to pick a problem, how your program receives its input (read this part even if you skip the rest), and how rewards are worked out.

Open it from Evaluate → Code Arena in the sidebar. You need to be signed in.

1. Find a problem​

The Code Arena home page lists topics:

KindExamples
TopicsGeneral, Development Basics, Interview Preparation, Data Structure, Advanced Data Structures, Algorithms, Competitive Programming, OOP, Scripting, Dynamic Programming, Code Optimization
Language tracksPython, Java, C, C++, PHP — each with its own subtopics

Open a topic and use the tabs across the top to browse it:

TabShows
RecentThe newest problems in the topic
PopularProblems most people are playing
Most Solved / Most AttemptedRanked by solves or by attempts
Generated by MeProblems you created with Surprise Me
Solved ProgramsProblems you have already solved
My FavoritesProblems you liked
LeaderboardThe leaderboard for this topic

Pick Easy, Normal or Hard to filter by difficulty. Your choice is remembered.

Each problem card shows its Zeal and Jolt reward and how many minutes you get. Select Launch Arena to open it.

Surprise Me​

Surprise Me asks the AI to write a brand-new problem for the topic and difficulty you picked. It costs Jolt — the dialog shows the cost, your balance and what you will have left before you select Generate.

Generation takes a couple of minutes, and you can have one running at a time. If you come back too early you will see "The problem statement is still being generated. Please check back…" — wait and try again.

The details:

  • It costs 8 Jolt, whatever the difficulty. The Jolt is taken only when the problem has been generated. If generation fails, you see "We are unable to generate a code for you. Please try again later." and keep your Jolt.
  • While it runs, a progress dialog reports each step — writing the problem, crafting the test cases and checking them against a reference solution. A problem whose test cases fail this check is fixed or discarded before you see it.
  • In a language track, Surprise Me writes a problem for that track's language.
  • When it is ready, the problem opens immediately, and it appears in your Generated by Me tab. Other players can find and play it too.
  • Its reward is set when the problem is written, like every other problem, and is shown on its card.

2. Start the timer​

Opening a problem shows a summary first: the reward, how many people have solved it, total submissions, difficulty, tags, category and Total Timing in minutes.

Select Start Program. The countdown starts now, and it is kept on the server — closing the tab or reloading does not pause it.

Each time you start the timer on a problem counts as one attempt. Your first Start Program is attempt 1. If the time runs out and you select Restart Program, that is attempt 2, and so on. Attempts lower the reward — see How rewards work. Renewing the timer before it runs out does not count as a new attempt.

3. The challenge screen​

Shown on labsdev.selfmade.ninja, a Selfmade Ninja Labs platform. On your own platform you will see your own domain and data.

Left panel — tabs:

TabWhat it is for
ProblemThe statement, constraints, CLI Argument Explanation with an example, STDOUT Explanation with an example, hints and tags
Code AI ✨A paid AI assistant for this problem — see Code AI
InstructionsKeyboard shortcuts and the reward rules
ResultYour last submission result, and Show Reviews for an AI review of your code
ReportReport a broken problem

Right panel: the language picker, your Zeal and Jolt, the countdown with a Renew Timer button, the editor, and the Run, Validate and Submit buttons.

Bottom panel: Test Cases, Terminal and Stats.

More than 40 languages are available. Problems in a language track are locked to that language.

ShortcutDoes
Ctrl + SSave
Ctrl + Shift + FLoad your saved answer
Ctrl + ERun

Your code is also saved automatically, separately for each language.

4. Input comes from command-line arguments, not the keyboard​

Your program does not read standard input

Test data is passed to your program as command-line arguments. Nothing is typed into it. input() in Python, scanf() in C or a Scanner on System.in in Java will get nothing — and your solution will fail every case even if the logic is right.

Read the arguments instead:

import sys

numbers = [int(x) for x in sys.argv[1:]]
print(sum(numbers))
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
int total = 0;
for (int i = 1; i < argc; i++) total += atoi(argv[i]);
printf("%d\n", total);
return 0;
}
public class Main {
public static void main(String[] args) {
int total = 0;
for (String a : args) total += Integer.parseInt(a);
System.out.println(total);
}
}

Two things to check on every problem:

  • CLI Argument Explanation on the Problem tab says what each argument is and in what order. Its example shows a real argument list.
  • STDOUT Explanation says exactly what to print. Output is compared as text, so an extra space, a missing newline or a debugging print fails the case.

The Terminal tab shows the command your program is run with. For Java it is java Main, so keep your class named Main.

5. Run, Validate, Submit​

ButtonRuns your code againstCounts as a submission?
RunArguments you type into the box above the terminal, or the example next to a test case (Run with arguments)No
ValidateThe test cases you can see — the visible ones plus any you have unlockedNo
SubmitEvery test case, including the hidden onesYes

Use Run and Validate as much as you like while you work. Submit is the one that is judged and the one that affects your reward.

There is a short cool-down between runs. If you run too often you will be asked to wait a few seconds.

The cool-down is 5 seconds per problem, shared by Run, Validate and Submit. Select any of them sooner and you see "Wait 5 sec for each submit/run"; nothing is run and nothing is counted.

Shown on labsdev.selfmade.ninja, a Selfmade Ninja Labs platform. On your own platform you will see your own domain and data.

After Submit you see one of All Test Cases Passed, Some Test Cases Passed, Some Failed or All Test Cases Failed, and for each case whether it passed, with memory, execution time and wall time.

Hidden test cases​

In the Test Cases tab, hidden cases show a padlock. When you submit, a hidden case tells you only whether it passed — not its arguments or expected output.

To see one, select its padlock and unlock it with Jolt. Each problem allows only a limited number of unlocks, and each costs more than the last. Once unlocked, the case's arguments and expected output appear, and Validate includes it.

UnlockCost
First hidden caseThe problem's Jolt reward
Second hidden caseTwice the problem's Jolt reward
A thirdNot possible — "You cannot unlock more testcases. Unlock limit reached."

The unlock dialog shows the exact cost, your balance and what you will have left. Unlocking is only possible while your timer is running.

6. The time limit and renewing​

The countdown is the deadline. When it reaches zero, every action is refused with "Session expired. The allotted time has passed." and the page reloads.

To keep going, select Renew Timer before the countdown runs out. Use the slider to choose how much time to add — the dialog shows the Jolt cost. Harder problems cost more Jolt per minute. If you do not have enough Jolt, the renewal fails.

Difficulty1 Jolt buysCost of the full 30 minutes
Easy2 minutes15 Jolt
Normal1 minute30 Jolt
Hard45 seconds40 Jolt
  • You can add up to 30 minutes in one renewal, and renew again as often as you like while the timer is still running.
  • The time is added to your current deadline, so renewing early loses nothing.
  • Once the countdown has reached zero, Renew Timer no longer works. Your only way back in is Restart Program.

If the time does run out, you can open the problem again and select Restart Program. That counts as another attempt, which lowers the reward.

When the time is up:

  • Run, Validate, Submit, unlocking hints, test cases or Code AI, and Report are all refused.
  • Nothing you already earned is taken away. If you solved the problem before the deadline, the reward stays paid.
  • Restart Program gives you a fresh countdown of the problem's full time. Hints, test cases and Code AI you unlocked stay unlocked.

7. How rewards work​

  • All or nothing. You are rewarded only when a submission passes every test case, hidden ones included. There is no partial credit.
  • Once per problem per language. Solving the same problem again in the same language pays nothing. Different compiler versions of the same language — several C, C++ or Python versions — count as one language.
  • Fewer tries pay more. Full Zeal and Jolt go to a solve on your first attempt with a single submission. More attempts and more submissions reduce the reward. The table below gives the exact deductions.
  • Another language pays a bonus. Solving a problem you have already solved, in a different language, pays 20% of the problem's full reward.
  • Code AI cancels the reward. See below.

When you solve a problem you get a notification, and it may count toward Code Arena achievements.

What your first solve pays​

Every problem has a full reward in Zeal and Jolt, shown on its card and at the top of the challenge screen. Your first solve pays a share of it, depending on which attempt you are on and which submission passed. Submissions are counted across all your attempts on the problem.

AttemptThe passing submission is your…You get
1st1st or 2nd submission100%
1st3rd to 6th submission90%
1st7th submission or later10%
2nd1st to 6th submission75%
2nd7th submission or later65%
3rd, 4th or 5thAny50%
6th or later1st to 11th submission30%
6th or later12th submission or later20%

The same share applies to both the Zeal and the Jolt.

Solving in more languages​

After your first solve has been paid, you can solve the same problem again in other languages:

  • Each new language pays 20% of the problem's full reward, in Zeal and Jolt, however many attempts or submissions it took.
  • Each language pays once. Compiler versions of the same language count as one: all the C versions are one language, all the C++ versions are one, and Python 2 and Python 3 are one.
  • Solving again in a language that has already been paid shows "Already rewarded for this language" and pays nothing.

Resubmitting​

You can keep submitting after you have solved a problem — to try a faster or shorter solution, for example. A resubmission is judged like any other and shows its results, but in a language that has already been paid it earns nothing more. Your first completion time is kept as your record for the problem.

Make the first submission count

Use Run and Validate until the visible cases pass, then Submit. Each extra submission lowers what you earn.

Code AI​

The Code AI ✨ tab is an AI assistant that can see your code and answer questions about the problem. Unlocking it costs Jolt, and:

Unlocking Code AI means no reward for that problem

The unlock dialog says so before you confirm: "Unlocking CodeAI will not earn you rewards — it's a learning session." The Jolt is spent and cannot be refunded.

Use it when you want to learn from a problem rather than score it.

The details:

  • It costs a quarter of the problem's Jolt reward, rounded to the nearest whole Jolt. The unlock dialog shows the exact cost.
  • It forfeits the reward in every language. Once Code AI is unlocked on a problem, no later solve of that problem pays — not the first solve, and not the extra-language bonus. Rewards you were already paid before unlocking it stay yours.
  • It stays unlocked for that problem, including after Restart Program, and gives you up to 500 questions.
  • It works only while your timer is running, and asking a question shares the same short cool-down as Run.

What costs Jolt​

ActionNotes
Surprise MeGenerating a new problem
Unlock HintEach problem has one hint. Its price is set per problem and shown in the dialog
Unlocking a hidden test caseAt most two per problem: the problem's Jolt reward for the first, twice that for the second
Code AIA quarter of the problem's Jolt reward. Also forfeits the problem's reward
Renew Timer1 Jolt per 2 minutes (Easy), per minute (Normal) or per 45 seconds (Hard)

Surprise Me costs 8 Jolt. Every paid unlock works only while your timer is running, and none of them is refunded.

Every unlock dialog shows the cost, your balance and what you will have left. See Zeal and Jolt for how you earn Jolt.

Leaderboards​

  • The Code Arena Leaderboard (Mastery Hall → Code Arena Leaderboard) ranks everyone by Zeal earned in Code Arena, then by problems solved.
  • Each topic has its own Leaderboard tab. It rewards harder problems, first-try solves, low memory use and solving in extra languages, and counts hints, unlocked test cases and extra submissions against you.

See Leaderboards and leagues.

Reporting a broken problem​

Problems are written by AI, and sometimes one is wrong. Open the Report tab, check every reason that applies, and select Submit:

  • Incorrect Questions or Answers
  • Missing Test Cases
  • Incorrect Logic
  • Inefficient Algorithm
  • Unrealistic Inputs
  • Time Complexity Issues
  • Compatibility Issues

You can report a problem once. Reports go to the platform's moderators.

You can only report while your timer is running. After you report, the Report tab disappears for that problem, and a second report is refused with "You have already reported an issue for this program." Reporting costs nothing and does not change your timer or your reward.

Achievements and the Code Arena Mastery Hall​

Code Arena has its own achievements — for example for the number of problems you solve, solving in many languages, solving at each difficulty, solving in a row, first-submission solves, and fast or memory-efficient solutions.

Like Spot Quiz achievements, they are not paid automatically. To collect them:

  1. On the Code Arena home page, select View All Achievements to open the Code Arena Mastery Hall.
  2. Open the Ready tab and select Collect Reward, or Collect All. The Zeal and Jolt are added to your balance.

You can Track up to three achievements to pin them to the Code Arena home page.

Common questions​

All my test cases pass in Validate, but Submit fails. Submit also runs the hidden test cases. Look at which hidden cases failed, and check your program against the CLI Argument Explanation and STDOUT Explanation — especially extra spaces, newlines and edge cases.

My program works on my computer but fails every case. Your program is probably reading standard input. Test data arrives as command-line arguments — see Input comes from command-line arguments.

I solved it, but got less than the full reward. The reward drops with each extra attempt and after the first couple of submissions. See What your first solve pays.

I solved it in C with a different compiler. Why no bonus? Compiler versions of the same language count as one language.

I unlocked Code AI. Can I still earn anything on this problem? No. Code AI forfeits the problem's reward in every language.

My time ran out just before I submitted. The deadline is checked by the platform, so a late submission is refused. Select Restart Program to try again — as a new attempt.

Next​