# Questions tagged [fastest-code]

The winner of a fastest-code challenge is determined by the runtime performance of the submissions. For fairness, all submissions should be benchmarked on the same machine, which usually means all submissions have to be tested by the host of the challenge. Alternatively, the submission can be compared to a reference program. For scoring by asymptotic time complexity, use [fastest-algorithm] instead.

207 questions
Filter by
Sorted by
Tagged with
1k views

• 10.6k
229 views

### Triangularly embed a graph on a surface

This challenge arises from a claim made in a MathOverflow answer and a paper linked in that answer which seems to back up the claim: Searching for triangular embeddings is much quicker than ...
• 3,807
688 views

### Generate all possible equations with 10 characters

Nerdle is a Wordle variant, in which instead of words, the answers are equations. Each equation entered in the game must be a valid one. Examples: 13³-1=2196, ...
• 151
401 views

### Simultaneously solve N-queens and no-3-in-line

An intriguing MathsSE question asked if there were large N-queens solutions where no three queens lie on a line. That question's body included the unique 4×4 solution up to symmetries ...
• 3,807
504 views

### Base64 fixed point

It can be proven that there's exactly one string of infinite length that remain same after base64 encoding ...
• 24.5k
2k views

### Tips for improving your score in fastest code challenges

Fastest code is a scoring method on this site where the goal is to write code that is as fast as possible. From the tag wiki: The winner of a fastest-code challenge is determined by the runtime ...
• 12.7k
597 views

### RADD decomposition of an integer

Introduction The $RADD(n)$ operation is defined as the sum of $n + [$ the number whose decimal representation are the decimal digits of $n$ in reverse order $]$, see A004086. After reversal, ...
378 views

### Smallest and largest 100-bit square with maximum Hamming weight

Introduction In the binary representation of a $k-$bit $(k>1)$ square number $n^2,$ not all bits can be $1$. The maximum number of $1$-bits (Hamming weight, $B$ for short) is given in ...
364 views

### Fastest code: Does a list of string contains %s, %d, %f, or %r?

The aim is to create an algorithm to detect that one of the string in a small list of strings contains %s, %d, ...
• 313
883 views

### As many near-repdigit primes as possible

A near-repdigit number is a positive integer where all the digits are the same, except one. For example 101 and 227 are near-repdigits. A near-repdigit prime is a near-repdigit that is also prime. For ...
3k views

### The smallest area of a convex grid polygon

I got an email from Hugo Pfoertner, an Editor-in-Chief at the On-Line Encyclopedia of Integer Sequences, with a terrific idea for a fastest-code challenge, which will also help verify or expand the ...
• 8,689
931 views

### Fastest Gematria calculator

Gematria is an ancient Jewish method to determine a numeric value of a letter sequence, using a fixed value for each letter. Gematria is originally applied to Hebrew letters, but for the context of ...
• 183
573 views

### Generate Fibonacci Primes Quickly

Unsurprisingly, fibonacci primes are primes that are also Fibonacci numbers. There are currently 34 known Fibonacci primes and an additional 15 probable Fibonacci primes. For the purpose of this ...
• 2,465
2k views

### fastest matrix multiplication on x86

This challenge requires integration with C, so you can stop reading if you're not interested. Matrix multiplication is a simple operation, but the performance depends a lot on how efficiently the code ...
• 2,365
1 vote
525 views

• 8,689
3k views

### Fastest draw in the west! [closed]

We're going rootin' tootin' cow-poke shootin! This is a simple contest, first program to draw their pistol wins. How it works: I require 2 things from you, an executable, and a command to be run from ...
• 3,831
201 views

### Print all digits of an integer [duplicate]

Challenge Given a positive integer, find the fastest way to iterate over its digits. Bytecode size doesn't matter as much as speed of execution. Examples For 6875, the program would output ...
417 views

### Patterns in Permutations

This fastest-code challenge is based partly on this MSE question and exists to extend some OEIS sequences, and create others. If I extend or create sequences based on this challenge, I'll link to this ...
• 8,689
361 views

### 2D Pathfinding with Momentum

You are piloting a spaceship, outfitted with an engine that can accelerate you at 1km/s^2 in the direction the ship is facing (you have very good inertial dampers). You also have thrusters which can ...
• 2,135
2k views

### Topologically distinct ways of dissecting a square into rectangles

I was asked by OEIS contributor Andrew Howroyd to post a Code Golf Challenge to extend OEIS sequence A049021. Would be super great to get a couple more terms for [...] A049021. Kind of thing [...] ...
• 8,689
268 views

### Compute the Three Dimensional Discrete Cosine Transform

Challenge I've checked that there is a question Compute the Discrete Cosine Transform which is a competition for implementing a shortest solution to compute the one dimensional discrete cosine ...
• 403
1k views

### Compute all close strings quickly

Input A string S of length between 10 and 16 inclusive. The characters are taken from the 95 printable ASCII characters, byte values 32 (...
319k views

### High throughput Fizz Buzz

Fizz Buzz is a common challenge given during interviews. The challenge goes something like this: Write a program that prints the numbers from 1 to n. If a number is divisible by 3, write Fizz instead....
• 2,627
3k views

### Fastest square root of an arbitrary size

We do seem to have a fastest square root challenge, but it's very restrictive. In this challenge, your program (or function) will be given an arbitrarily sized nonnegative integer, which is the square ...
• 18.7k
187 views

### No. Of Factors Does the Number Have [duplicate]

Create a function which takes in a input integer and then returns the number of factors it has, like if you pass 25 then it will return ...
• 155