# All Questions

14,098 questions
Filter by
Sorted by
Tagged with
5 views

### NaN is not equal to NaN

In many programming languages, the floating-point value NaN, or "not a number", in some programming languages generated by the expression ...
1k views

### Find 10 float64s that give the least accurate sum

Input Integer $n > 1$ Output Ten 64 bit floating point numbers between $-n$ and $n$, inclusive, whose sum is the least accurate. Details and examples. These examples are not claimed to be ...
• 3,084
1 vote
198 views

### Write a function that takes an input string and encodes it using a modified Fibonacci sequence in reverse [closed]

Given an input string, first convert each character to its ASCII value. Generate a reversed Fibonacci sequence of the same length as the input string. Encode each character by adding its ASCII value ...
• 21
1k views

• 7,423
1k views

### Sum of square roots (as an algebraic number)

An algebraic number is a number that is a root of a non-zero polynomial with integer coefficients. It is well-known that the sum of two algebraic numbers is algebraic. In particular, the sum of a list ...
• 48.6k
1k views

### Find characters common among all strings

Find characters common among all strings You are given multiple Strings as an input. Your task is to find the characters that are present in every string, and ...
• 299
560 views

### Build the first 6 letters of an Italian codice fiscale (tax identification number)

Given a single string with a person's name and surname, output the first 6 characters of their codice fiscale. Codice fiscale Codice fiscale is a 16-character long alphanumeric string that identifies (...
• 3,685
310 views

### Find the most isolated point

Given two non-empty sets of points $P,T = \{(x,y)\ |\ x,y \in \mathbb{Z} \}$, find the point $p \in P$ such that it is the "most isolated" from all points in $T$. The "most ...
• 9,796
271 views

### Clicks for minesweeper [duplicate]

Given a mine map of minesweeper, output how many left clicks at least needed to win the game. Each left click reveals a cell, and if there's no mine in the 3x3 range, recursively reveal nearby 3x3 ...
• 24.5k
1k views

### Is this a valid PZN?

Is this a valid PZN? A Pharmazentralnummer, or PZN, is an eight-digit code which uniquely identifies medications, medical products, and similar items in the German healthcare system. Examples include ...
604 views

### Looping counter extended

The looping counter is a challenge that prints an infinite number of lines. The first line has one *, the next line has one more ...
• 1,075
1k views

### Output the inventory sequence

Goal Write a program that outputs this list: ...
284 views

### Calculating Graph Powers

Calculating Graph Powers (very similar to my other question asked here) According to Wikipedia, "the $k$th power $G^k$ of an undirected graph $G$ is another graph that has the same set of ...
• 550
4k views

### Cellular Automata Rule 30

What are cellular automata? Cellular automata describes a broad category of computational models that covers various cellular automations, some of the most intriguing of which involve 'simple' rules ...
• 197
2k views

### Break a word into vowels and consonants

Objective Given an string $n$, output two strings, namely the string consisting of vowels "a", "e", "i", "o", and "u", and the string consisting of ...
• 311
1k views

### Compare two strings, with NaC

I just thought of this idea: if we have NaN ("not a number") for floats, how about NaC ("not a character") for a single unknown character in a string? Your input should be two ...
794 views

### Convert CSV tables to MediaWiki tables

Input a CSV table, like this: data00,data01,data02,...,data0m data10,data11,data12,...,data1m ... datan0,datan1,datan2,...,datanm The cells in the CSV table is ...
• 1,075
1k views

### Is this a solvable Numberlink?

Challenge Per Wikipedia: Numberlink is a type of logic puzzle involving finding paths to connect numbers in a grid. The player has to pair up all the matching numbers on the grid with single ...
• 1,477
669 views

### Complex Exponentiation [closed]

As the title says! Raise one complex number to the power of another. (a+bi)^(c+di)(using the principal branch of the complex logarithm) Requires four inputs a, b, c, d. You can combine a, b, c, d into ...
3k views

### Cold Bee and Old Beer

Introduction: Inspired by this silly meme video, which states 'COLD BEER', but is slightly too large for the scrolling advertisement board, causing it to display either 'COLD BEE' or 'OLD BEER' ...
• 128k
1k views

### Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

The Horrible Histories song "Learn Your Hieroglyphics" mentions a fanmade number system. Numbers are written as a sum of 10's ("hoops") and 1's ("eyes"), for example 99 ...
1k views

### Decode a Caesar ciphertext with high probability

Caesar ciphers A Caesar cipher with shift=N is the process of replacing any alphabetic character in a string with the letter which is N positions ahead in the alphabet (wrapping back at the beginning)....
• 3,685
2k views

### Compute the degree of a string

The input is a string made of the letters a,b,c only. The output is an integer representing the degree of the sequence. The degree of a sequence is computed as follows: Assume that each of the ...
• 1,993
231 views

### Integrate a function from -1 to 1 [closed]

Create a function or program that takes any continuous, well-defined, single-input function (f(x)=...) and returns an approximate integration from -1 to 1. (at ...
895 views

### Construct a uInt from an array of bits

Task is simple! Take an array of binary values (can be boolean, 0/1, etc.) and use those bits to construct an n-th bit long unsigned integer (return type does not need to be an unsigned integer, just ...
363 views

### Where are zeros? Self-describing sequence

Background A167519: Lexicographically earliest increasing sequence which lists the positions of the zero digits in the sequence. ...
• 77k
2k views

### Decode Caesar cipher based on a given text

I can't think of a better name. This is similar to this challenge, but a lot easier. Read three strings which contain only uppercase letters. The length of the first and second strings are the same. ...
• 1,075
985 views

### Golfing the complexity with subtraction

The Mahler-Popken complexity, $C(N)$, of a positive integer, $N$, is the smallest number of ones ($1$) that can be used to form $N$ in a mathematical expression using only the integer* $1$ ...
• 108k
264 views

### How can I reduce the characters in the following python code? [closed]

The following code is 47 characters. print(("Ekki v","V")["COV"in input()]+"eikur!") How can it be reduced to 46 or less? I ...
458 views

### How far are you?

Write a program that gets coordinates of two objects on Earth, and calculates how far they are from each other directly in space (a straight line through Earth) and on the surface (through the ...
788 views

### *Trivial* near-repdigit perfect powers

Task Output the sequence that precisely consists of the following integers in increasing order: the 2nd and higher powers of 10 ($10^i$ where $i \ge 2$), the squares of powers of 10 times 2 or 3 (...
• 77k
3k views

### Anti Tic-Tac-Toe

The rule of Anti Tic-Tac-Toe is like Tic-Tac-Toe. The rules are: There is a 3*3 grid, the squares in the grid are labeled 1 to 9: 123 456 789 ...
• 1,075
587 views

### Find the rule of a cellular automaton

There are already many challenges where you are given a cellular automaton rule and an initial state and you have to find the state after a certain number of steps. This challenge is the opposite: you ...
• 48.6k
3k views

### 3 Dimensional Minesweeper

3-Dimensional Minesweeper I've been on a minesweeper kick for a while, but all the questions are for 2 dimensions (or that one in 1D). But 2D is 2 easy! Challenge Write the shortest code possible to ...
• 4,135
1k views

### HTML Table Parser

Input a strict subset of HTML <table> string representation as defined below. Output parsed table, while any cells who span multiple rows or columns, record ...
• 34.9k
675 views

### Sith TIE-Fighter

Today is May 5th which means it's Star-Wars Day episode II: Revenge of the 5th. For this task, you will output the following image of a Sith TIE-fighter: ...
• 7,423
1k views

### X-Wing Starfighter

Today is May 4th, Star Wars day, so here's a Star Wars ASCII-art task. Output this image of an X-Wing starfighter: ...
• 7,423
1k views

### Visually arrange multi-day events on a calendar

The arrangement algorithm I think I've determined the algorithm that Google Calendar uses to visually arrange day-long and longer events at the top of the "Week" view (you may have an ...
• 3,685
972 views

### Divisibility patterns

Your inputs are a string and an integer. Your output is the 2d matrix of strings achieved from adding 0 to N spaces between each ...
• 643
1k views

### Infer pluses and minuses

The problem Consider an equation such as      "3 ± 2 ± 4 ± 1 = 4"      and determine if there exists a sequence of pluses and minuses that makes it arithmetically correct. If it exists, ...
• 3,685
1k views

### Enumerate all matches of a regex

related For this challenge, we'll be using a simplified dialect of regular expressions, where: A lowercase letter from a to z ...
• 38.8k
1k views

### Interpret PlusOrMinus

PlusOrMinus is an esoteric programming language invented by Esolang user PythonshellDebugwindow. Language specification There is a wrapping byte accumulator (incrementing ...
• 1,075