# 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.

202 questions
Filter by
Sorted by
Tagged with
675 views

### Count the size of the Levenshtein neighborhood

Input A binary string $s$ of length $n$ and a positive integer $k \leq n$. Output The number of binary strings with Levenshtein distance exactly $k$ from the string $s$. Example outputs Each ...
507 views

### Compute convolution quickly and accurately

Input An array A of integers of length 100,000. The array will contain only integers in the range 0 to 1e7. Output The convolution of A with itself. As this will be of length 199999 you should time ...
792 views

### Compute the chromatic number of special graphs

This challenge is about computing the chromatic number of special types of graphs. Input The input will consist of two integers. A positive integer $n > 1$. A distance $d < n$. Task The ...
2k views

### Calculate max depth of JSON data

Challenge Given some JSON data, calculate the maximum depth reached. (Both arrays and dictionaries increase the depth) Input/Output The program is expected to read a JSON string from stdin and as soon ...
1k views

### How many sorting networks?

Below on the left is a picture of a sorting network that can sort 4 inputs. On the right you can see it sorting the input 3,2,4,1. A sorting network of size ...
267 views

### Generate all possible equations from a list of numbers [closed]

This is my first codegolf post so let me know if I have missed anything. Thanks :) Description You are given a list of numbers with 2 < n <= 6 length i.e. [1, ...
602 views

### Record Least Uncommon Multiple Counts

The Greatest Common Divisor, or gcd, of two positive integers $x$ and $y$ is the largest positive integer that divides both $x$ and $y$. The Least Common Multiple, or lcm, of two positive ...
203 views

541 views

### The maximum liberty of a group on a Go board

Bounty One of the convincing conjectures, by Loopy Walt is, ...
2k views

### Quicksand (piles)

In this fastest-code challenge, you take a positive integer as input, which represents the height of a sand pile, located at (0,0) on an infinite square grid. For example, if our input is ...
1k views

### High throughput prime numbers

This challenge is inspired by the High throughput Fizz Buzz challenge. The goal Generate a list of prime numbers up to 10,000,000,000,000,000. The output of primes should be in decimal digits followed ...
746 views

### Write the most optimized assembly program to detect a prime number (from a bigger range!)

This is the second version of the task. The original task had a defect that the given range of integers was too small. This was pointed out by @harold that other methods couldn't defeat the way of ...
1k views

### An Scalable Event Scheduler That Can Handle Billions of Events [closed]

The event scheduler is a recurrent theme in event-driven architectures: something triggers an event that needs to be checked in the future one or more times. I has particular use in trading where you ... 585 views

### Fast Matrix Multiplicator Evaluator

A triplet of real tensors $(A,B,C)$ of size $\gamma \times \gamma \times \sigma$ represents a matrix multiplication algorithm with $\sigma$ elementary multiplications iff the following function ...
980 views

### Bigram frequencies in text

Introduction This challenge is about producing a code to count the frequency of bigrams in a text. A bigram is two consecutive letters in a text. For instance 'aabbcd' contains the bigrams aa, ab, bb, ...
520 views

### Compute the size of intersections of sets

Input A positive integer N representing the size of the problem and four positive integers v, x, y, z. Output This is what your code should compute. Consider a set of N distinct integers and consider ... 407 views

### Swap encoding iteration count

Introduction In this challenge, I asked you to implement swap encoding. Swap encoding is an encoding method where you iterate through the string, reversing substrings between identical characters. The ...
431 views

### Fastest unique finder

Given 4096 16-bit integers, only four of which are unique and others appeared twice (so 2050 different integers exist). Find the four uniques. To time precisely and limit RAM usage, your program will ...
416 views

592 views

### How quickly can you convert an NFA to a DFA?

Convert NFA to DFA as quickly as possible. Input Your input will be an NFA. In order to be able to test your code, it needs to be able to handle an NFA in the following format. This is taken ... 