CODE GOLF

Shorter. Smarter. Sharper.

to
Starts in

About

Welcome to Code Golf, the ultimate challenge where less is more!

In this online event, participants are given a programming problem — but unlike traditional coding contests, the goal here is to solve it using the shortest possible code. The fewer characters you use, the higher you score!

You can code in any programming language of your choice — Python, C++, JavaScript — as long as your code works and is shorter than your competitors

Rules

  • The creator of this contest is solely responsible for setting and communicating the eligibility requirements associated with prizes awarded to participants, as well as for procurement and distribution of all prizes. The contest creator holds HackerRank harmless from and against any and all claims, losses, damages, costs, awards, settlements, orders, or fines.
  • Code directly from our platform, which supports over 30 languages. Learn more here.

Objective: Solve the given problem using the shortest working code (measured in number of characters).

Language: Any programming language is allowed.

Shortest correct code wins.

In case of a tie (same character count), the faster submission takes priority.

Solutions will be manually verified for correctness and output.

Code must be original — plagiarism or AI-generated code without mention will lead to disqualification.

Scoring

Primary Criterion: Shortest correct code wins (minimum number of characters).

Ties: If multiple participants submit code of the same length:

The one who submitted earlier wins.

Submissions are automatically scored by HackerRank, but final character count will be manually verified by the organizing team (if required).

Invalid or incorrect output = 0 points, regardless of code length.

Sign up for CODE GOLF now.

Not a genuine coding contest?