# All Questions

10,576 questions
107 views

### Convert alphanumeric (base-36) sentences into hexadecimal (base-16) sentences

I use "sentence" here loosely to mean "any sequence of words separated by spaces" and "words" to mean "sequences of alphanumeric (hexatrigesimal) characters unseparated by spaces". Conversion is from ...
183 views

### Maximum summed sub sequences with no two numbers sharing the same digit [on hold]

Suppose there are 5 positive integers in an array or list as 14, 12, 23, 45, 39. 14 and 12 cannot be taken in the subset as 1 is common in both. Similarly {12, 23}, {23, 39}, {14, 45} cannot be ...
100 views

### Convert between Korean two-set keyboard and qwerty keyboard

Introdution It is somewhat like DVORAK Keyboard layout , but MUCH harder. Let's talk about Korean keyboard first. As you can see in Wikipedia, there is Kor/Eng key to change between Korean and ...
272 views

### Point out a string character [on hold]

Introduction In many programming languages, within syntax exceptions, it is often pointed out to the programmer exactly which character or line is the culprit. This challenge will be a bit of a ...
2k views

Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, ...
2k views

### Count rotary dial pulses in a phone number (including letters)

In your grandparents' day, dialing a phone number was done with a rotary dial like this: To dial each digit, put your finger in the corresponding hole, pull it over to the finger stop, and release it....
140 views

### Random Cake Bake

Warning: This is a bit lengthy I have decided to build my own random function I call it "Random Cake" This function should get an integer value between 0 and 99999 Ingredients ...
187 views

### Havel-to-da-Hakimi [duplicate]

It was a dark and stormy night. Detective Havel and Detective Hakimi arrived at the scene of the crime. Other than the detectives, there were 10 people present. They asked the first person, "out of ...
13k views

We all know the classic dad joke that goes something like this: Somebody says a sentence to describe their self (e.g. I'm tired or ...
5k views

### Gravitational Force Between Numbers

The gravitational force is a force that attracts any two objects with mass. In this challenge our objects will be Numbers and their mass will be their value. To do so, we don't care about the strength ...
142 views

### Sliding retrieval

Thanks, Uncle (the story) My slightly mad uncle recently left for the space colonies, and passed his pallet goods business to me. The rectangular warehouse is full of pallets of goods except for the ...
100 views

### Minimum cost for the machine [closed]

Benjamin has N boxes in his garden with dimension xi*yi*zi each. Because he does not want to let them out and get wet, he wants to put them in the warehouse with a capacity of V. To solve this problem,...
518 views
+50

### Output first $n$ digits of $\pi^{1/\pi}$

This challenge is to produce the shortest code for the constant $\pi^{1/\pi}$. Your code must output the first $n$ consecutive digits of $\pi^{1/\pi}$, where $n$ is given in the input. ...
2k views

### To exponential digit growth and beyond!

Challenge Given a base $1 < b < 10$ and an index $t \ge 1$, output term $x_t$, defined as follows: $x_1 = 11_{10}$ $x_{i+1}$ is obtained by converting $x_i$ to base $b$ and then ...
223 views

### Knights and Knaves and Codes

In this challenge, your bot has landed on an island with the stereotypical knights and knaves. Knights always tell the truth, and knaves always lie. The objective is to find the correct 32 digit ...
2k views

### Surface of the 3x3x3 cube as a graph

Your task is to generate a graph with 54 vertices, each corresponds to a facet on a Rubik's cube. There is an edge between two vertices iff the corresponding facets share a side. Rules You may ...
70 views

### Programming challenge [closed]

We recently started a data science community within our company. To get everyone warmed up, we want to set out some sort of programming / data science coding challenge. This can for example be a ...
2k views

### Split into three!

Given a string, you've to split it into groups of three characters (by padding _ at the end). Related, but still it's different. Sample I/O: ...
706 views

### Expand a hexagon

Given an ASCII art hexagon as input, output one whose sides are all one unit longer. ...
1k views

### Warped chessboard

This challenge is about building a chessboard in which the square size, instead of being constant across the board, follows a certain non-decreasing sequence, as described below. The board is defined ...
1k views

### Save my secrets!

I have so many secrets and nowhere to keep them! The goal is simple: write a program that lets you save a string and have it be protected by a password. The program will take an alias, password and (...
4k views

### pwaS eht tirsf dna tasl setterl fo hace dorw

Or, "Swap the first and last letters of each word" Your challenge is to, given a string of alphabetical ASCII characters as well as one other character to use as a delimiter (to separate each word), ...
4k views

### Gambler's Fallacy Dice

The gambler's fallacy is a cognitive bias where we mistakenly expect things that have occurred often to be less likely to occur in the future and things that have not occurred in a while to be more ...
262 views

### Convert a number into “bracket” numerals

"Bracket" numerals are a type of 'numerals' I made up once, and thought would be a nice challenge here. Basically, you convert the input number into base 6, and then transliterate the ...
3k views

### Parse a C++14 integer literal

According to http://en.cppreference.com/w/cpp/language/integer_literal, integer literals consist of a decimal/hex/octal/binary literal and a optional integer suffix, that is obviously completely ...
1k views

### Divisor Rich and Poor Numbers

Introduction In the strange world of integer numbers, divisors are like assets and they use to call "rich" the numbers having more divisors than their reversal, while they call "poor" the ones having ...
3k views

### ​Cuban​ ​Primes

Given a natural number $n$, return the $n$-th cuban prime. Cuban Primes A cuban prime is a prime number of the form $$p = \frac{x^3-y^3}{x-y}$$ where $y>0$ and $x = 1+y$ or $x = 2+y$ ...
279 views

Background Ada is a programming language that is not exactly known for its terseness. However, its array literal syntax can in theory allow for fairly terse array specifications. Here is a simple ...
277 views

Two ambassadors at a UN conference want to speak to each other, but unfortunately each one only speaks one language- and they're not the same language. Fortunately, they have access to several ...
1k views

### Generate ladder of integers using the least number of unique characters (in C++)

I am new to the sport of code golf. I am trying to generate a ladder of integers using the least number of unique characters in C++. Let's say we are given an integer 4. We will generate the ...
371 views

### Find all $k$-smooth pairs

Introduction In number theory, we say a number is $k$-smooth when its prime factors are all at most $k$. For example, 2940 is 7-smooth because $2940=2^2\cdot3\cdot5\cdot7^2$. Here, we define a ...
3k views

### Program which behaves differently in/out of a debugger [closed]

The challenge is to write a deterministic program (any language/OS) which takes no arguments or other input and behaves differently in a debugger from how it behaves when not being debugged. For ...
1k views

### Automatically anti-predictably assemble an alliterative aria

Thanks to @ComradeSparklePony for the title. This challenge should be very simple. You are given three lists. The first is a list of first names, in title case. The second is a list of adjectives, ...
102 views

### Building a Structured Outline [closed]

In a fictional document management system, input documents are structured with weighted headings. Lowest weighted headings are the most important. This is a sample document: H1 All About Birds H2 ...
581 views

### Extrude the faces of a cube symmetrically along XYZ

Sandbox For the purposes of the current task, a cube of unit length is rendered in oblique projection with ASCII symbols as follows: ...
7k views

### As programmers say: Strive to be lazy

Story Have you seen this post from 9gag? Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal ...
190 views

### Country Code Transformations

Background and Motivation: IOC Country Codes are three letter abbreviations that are commonly used when broadcasting the Olympic Games. The last two letters of some codes overlap with the first two ...
1k views

### Make all the squares explode

You are given a square matrix of width $\ge2$, containing square numbers $\ge1$. Your task is to make all square numbers 'explode' until all of them have disappeared. You must print or return the ...
359 views

### Composite Factor Soup

Per the fundamental theorem of arithmetic, for a given number $n$, it is possible to find it's prime factors, and they are unique. Let's imagine we talk only of $n$ that is non-prime (composite). ...
564 views

### Output the date in the Mel calendar

The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar. This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last ...
5k views

### Is it a Munchausen Number?

A Munchausen Number in base $b$, also known as a Perfect digit-to-digit invariant or PDDI is a peculiar type of positive integer where the sum of its base-$b$ digits raised to themselves is equal ...
584 views

### Hungry Blobs KoTH

Contest Finished! Read comments on blobs to view their score. This KoTH is loosely inspired by Primer's Natural Selection Simulation. Your bot is a blob. In order to survive, you must eat pellets to ...
188 views

### Roots of Arbitrary Numbers [closed]

One day, when I was bored in maths class, I learned of a neat trick for solving the real cube root of a number! Let's use the number $79,507$ as an example. First, take digit in the one's place ...
82 views

### Check if the knight move in chess is valid or not? [duplicate]

Consider an array which represent chessboard. Its length is 64. The first 8 elements represents first row the next ...
989 views

### Magical Modulo Squares

I'm a big fan of number theory. A big thing in number theory is modular arithmetic; the definition being $a\equiv b\mod m$ if and only if $m\mid a-b$. A fun thing to do is raising to powers: ...
391 views

### Find the area of the smallest rectangle to contain squares of sizes up to n

This is a sequence question of the usual type, as applied to OEIS sequence A038666. That is, do either of the following: Accept no or any input, and output A038666 until the heat death of the ...
3k views

### Convert Numbers To Emoji Math [closed]

In Emoji Math, a user created module for the video game Keep Talking And Nobody Explodes, numbers are written as strings of emoticons, where each emoticon represents a base 10 digit. Below is the ...
462 views

### Rock, Paper, Scissors, Lizard, Spock Tournament

Giving a challenge involving a Star Trek reference just after May the 4th may be frowned upon, but here goes. You, Luke, Anakin, Palpatine, Yoda and Han Solo are involved in an insane tournament of ...