# All Questions

13,814 questions
Filter by
Sorted by
Tagged with
473 views

### Find a string in the middle

Given two strings $A$ and $B$ with edit (Levenshtein) distance $x$, find a third string with edit distance $a$ to $A$ and edit distance $b$ to $B$ so that $a+b=x$ and $a=int(x/2)$ (...
906 views

### Is it a canonical elementary CA rule number?

Background Given an elementary cellular automaton rule number like, for example, 28 = 00011100… We can swap $\color{red}{\text{the 2nd bit with the 5th bit}}$ ...
395 views

### Zeckendorf to F(4k+2) representation

Background Fibonacci numbers are defined as follows: $$F_0 = 0, F_1 = 1, F_n = F_{n-1} + F_{n-2}$$ The Zeckendorf representation is a representation of positive integers as a sum of one or more non-...
475 views

401 views

### Stevin's Notation

Stevin's Notation is a way to represent decimals in a non-fractional way. The Flemish mathematician and engineer Simon Stevin is remembered for his study of decimal fractions. Although he was not the ...
1 vote
58 views

### How Many Staircases [duplicate]

Problem You're a staircase engineer on a house and realize you only have n rectangles to create a staircase. So you are tasked with finding the number of ways to ...
1k views

### Decode Chess Move

As the title says, given a valid chess move in algebraic notation, produce the string describing the move. Example: ...
4k views

### Repeat your program to print Fibonacci numbers

Write a program fragment so that, when repeated N times it prints the Nth Fibonacci number. For example, if your program is print(x) then: ...
1k views

### The rectangle spanned by two numbers

One way to generalize the concept of a range from the integers to the Gaussian integers (complex numbers with integer real and imaginary part) is taking all numbers contained in the rectangle enclosed ...
721 views

### Otteretto Classic game scoring method

Brief description of the game In the game Otteretto Classic (which you can test directly in your browser; try it!) the player has to form palindromic sequences using adjacent cells on a square grid. ...
1k views

3k views

### Is it a valid Go type?

Write the shortest program or function that will determine if an input is a valid Go type. Spec This challenge will use the following simplified subset of Go types. For more information, see the ...
679 views

### Buzzing Bill's Newspaper: Four Letter Splits

"Buzzing" Bill is a well respected beaver. He is the hardest working in his home dam. He was a strong beaver and was able to lift more logs than anyone at the dam. Unfortunately Buzzing Bill'...
2k views

### Round up to a smoother number

Input Two positive integers a > b Output The smallest integer c >= a so that c can be ...
1k views

### Calculate the aspect ratio of the Nepal flag

Above is the picture of the flag of the country Nepal. Pretty cool. What's cooler, is the aspect ratio, which is defined under the constitution as: That formula in copyable form:  1 : \frac{...
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 ...
387 views