All Questions

4
votes
0answers
43 views

Convert an ASCII art table to a UTF-8 table

When I write documentation, comments, etc. I love making ASCII tables. They usually end up looking pretty good, but I always feel that they could look even better - especially since UTF-8/Unicode ...
2
votes
17answers
201 views

String analayser

Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) ...
11
votes
5answers
899 views

Blind Random Sort

Here's a pretty common pattern for sorting algorithms: ...
5
votes
5answers
201 views

Japanese pitch accent numbers

Your challenge is to turn a Japanese word and a dictionary pitch accent number into a new string where the rises and falls in pitch are marked: e.g. (2, ウシロ) → ウ/シ\ロ...
19
votes
22answers
2k views

Print a Wavy String Line-by-Line

Challenge Write a program or function that takes in a string s and integer n as parameters. Your program should print (or ...
18
votes
12answers
2k views

A Semi-palindrome Puzzle

An palindrome is a word that is its own reverse. Now there are some words that might look like palindromes but are not. For example consider the word sheesh, <...
30
votes
38answers
5k views

List all possible titles for the Anno games

In the Anno video game series there are 6 games with a 7th one announced for early 2019. Their titles always feature a year in a specific pattern: ...
-2
votes
0answers
134 views

Looking for teammates [on hold]

everyone is looking for a teammate. There are N contestants (numbered 1 through N) who want to participate let's denote the skill level of the i-th contestant by \$S_i\$. These people want to pair up ...
-2
votes
3answers
228 views

Send the pairs in smallest output

Write two programs A and B: Program A takes 1024 pairs of integers \$(a,b)\$, where \$0≤a<2^{32}\$ and \$0≤b<1024\$, and all \$a\$ will be different. It will output a single positive integer. ...
20
votes
24answers
2k views

Minimal Power Root

The minimal power iteration of a number \$n\$ is defined as follows: $$\text{MPI}(n):=n^{\text{min}(\text{digits}(n))}$$ That is, \$n\$ raised to the lowest digit in \$n\$. For example, \$\text{MPI}(...
7
votes
5answers
246 views

Multiply numerical polynomials

A numerical polynomial is a polynomial \$p\$ in one variable with rational coefficients such that for every integer \$i\$, \$p(i)\$ is also an integer. The numerical polynomials have a basis given by ...
1
vote
1answer
165 views

Describe a 2D Bitmap Using Filled Rectangle Mapping

Idea: Consider a 2-bit bitmap of arbitrary side-lengths overlaid on a coordinate grid and imaged with random data (1's represent an element of the image, 0's represent the "blank" canvas background):...
1
vote
2answers
162 views

(Javascript) itertools.groupBy, e.g. [0,0,1,1,0] -> [[0,0],[1,1],[0]]

(language-specific challenge) Specification: Language: ECMAScript, any version[1] Challenge: Somewhat like python's itertools.groupBy: Your function ...
17
votes
32answers
2k views

Text compression

With the given text below, there are some words in the text that repeats several times in the text. Use any programming language to write a short code that compresses the text to display it. Or in ...
10
votes
1answer
128 views

Tatamibari solver

Background Tatamibari is a logic puzzle designed by Nikoli. A Tatamibari puzzle is played on a rectangular grid with three different kinds of symbols in it: +, <...
-1
votes
0answers
66 views

1000^3 space, 10 bombs and a spaceship [on hold]

Some time ago I had a coding test, kind of riddle: there is 3D space 1000x1000x1000 (each 1-1000, integer), 10 bombs are randomly located in this space, place one spaceship as far as possible from ...
21
votes
14answers
1k views

What numbers are these?

While I was writing numbers I noticed after a while that my keyboard had the Shift key pressed and blocked and all I wrote was $%&-like characters. And even ...
6
votes
3answers
156 views

Chiral three dimensional texts

Two dimensional chiral objects are not chiral in three dimensional space. This is because you can flip them over which is equivalent to taking the mirror image unlike in two dimensions where only ...
3
votes
0answers
123 views

Gold Hunter KoTH

This challenge is based off of Gold Collector KoTH. In this KoTH, the aim is to be the winner. Wait, I need to be more specific? Objective Collect the most coins without dying. Coins are spread ...
2
votes
11answers
342 views

Cycle my input please [duplicate]

Input A string s of printable ASCII characters, newlines, and spaces (0x20 ( ) to 0x7E (~)),...
-3
votes
0answers
41 views

Least possible sum by using only 2 operations [closed]

If a number is given and an other number say s . Condition is u can only perform 2 operations: either u can sum the digits of number or u can add s to the number. So what will be the least possible ...
15
votes
2answers
471 views

Pentomino 6x10 solution normalizer

As you most probably now, there are 2339 solutions to pentomino puzzle in a 6x10 grid. There are different labeling schemes for the 12 pentominoes, two of them are shown on the image below: Image ...
-1
votes
0answers
44 views

Order the array of mixed collections [closed]

I am trying to order this array in Javascript arr = ["ax", "mof", "4", "63", "42", "3", "10", "[", "23", "adidas", "ba", ")", "ABC"]; And i want that the array is showed like this: ["3", "4", "10", ...
15
votes
15answers
2k views

Output the anti-clockwise inward spiral of a 2D array

From this stackoverflow question Given a 2D array of size \$ M \times N \$, output the values in a anti-clockwise fashion. The output must start from the outside to the inside and the initial point ...
-3
votes
0answers
45 views

Power sequence variant [closed]

Suppose I've a sequence like below.. 2 4 6 8 1 1 2 3 9 2 4 6 8 10 My task is to figure out power sequence like 2 4 6 8 - 2 3 9 - 1 And print them along with the count.. any great ideas on how to ...
1
vote
2answers
130 views

Accordion Solitaire: Which First Moves Can I Make?

Introduction: Unfortunately an Accordion Solitaire Solver challenge already exists (Solve a game of Accordion), so instead this easier related challenge. Let's start by explaining how Accordion ...
-1
votes
0answers
37 views

Sorting of XML with XSLT by Tag Name [closed]

i have a little problem that i can't solve. I have an XML file an want to sort it with XSLT. The other sorting with XSLT worked, but not this problem. I have an XML-file like that an i want to sort ...
2
votes
1answer
211 views

Longest Seven Segment Word

This question was inspired by Tom Scott's video here. The English language has plenty of words, but what's the longest one that can be displayed on a seven segment display? Your challenge is given a ...
30
votes
22answers
5k views

Can the number be split into powers of 2?

Yesterday while playing with my kid I noticed the number in his toy train: So we have $$4281$$ that can be split into $$4-2-8-1$$ or $$2^2-2^1-2^3-2^0$$ So simple challenge: given a non-negative ...
-3
votes
0answers
70 views

Miranda challenge [closed]

How would that short function be converted into Miranda code: ...
16
votes
13answers
1k views

Arbitrary Length Hashing

Consider you have a hash function \$\mathcal{H}\$ which takes strings of length \$2n\$ and returns strings of length \$n\$ and has the nice property that it is collision resistant, i.e. it is hard to ...
12
votes
5answers
361 views

ASCII Calendar Planner

Given a list of activities and their start time/date, output an ASCII-art calendar showing the activities on the appropriate days. All activities are guaranteed to be in the same month, no two ...
0
votes
0answers
129 views

Meeting splitter

Introduction Large meetings waste working time. Our aim is to split a large meeting into a number of smaller meetings, so the average number topics that a person discusses is minimized but every ...
20
votes
14answers
5k views

One line Keyboard

The Challenge The goal of this challenge is to determine whether a given String can be typed using only one line of a standard UK QWERTY keyboard. This is ...
0
votes
0answers
83 views

Java program for for floating algorithm [closed]

We have 10 places and 14 people in a team. We need to put 4 people on floating which should change every week. The 10 team members are divided into 4 smaller projects. At any given time, not more than ...
17
votes
8answers
2k views

Ternary-if Converter

In Java/.NET/C/JavaScript/etc. you can use ternary-ifs to shorten if-statements. For example (in Java): ...
-1
votes
0answers
69 views

Vigenere Cipher with a Catch [duplicate]

What is a Vigenere Cipher? The Vigenère cipheris a method of encrypting alphabetic text by using a series of interwoven Caesar ciphers, based on the letters of a keyword. It is a form of ...
15
votes
5answers
763 views

The Binary Fences

Input: An integer n in the range 2 <= n <= 10 A list of positive integers Output: Convert the integers to their binary ...
33
votes
37answers
4k views

Be there, for the square

Sometimes when you're lying in bed and reading a message, your phone screen will pop into landscape mode right in the middle of a sentence. Only being able to read left to right, you find yourself ...
4
votes
3answers
161 views

Optimizing edge selection from a list of numbers

You are given a list, L, with the length N. L contains N random positive integer values. You are only able to select from the outer edges of the list (left/right), and after each selection every value ...
18
votes
26answers
3k views

Converting a number from Zeckendorf Representation to Decimal

About Zeckendorf Representations/Base Fibonacci Numbers This is a number system which uses Fibonacci numbers as its base. The numbers consist of 0 and 1's and each 1 means that the number contains ...
12
votes
21answers
2k views

Longest Increasing Substring

Given a list of positive integers, write code that finds the length of longest contiguous sub-list that is increasing (not strictly). That is the longest sublist such that each element is greater ...
6
votes
3answers
175 views

Scoring Chinese Hearts

Chinese Hearts, also known as Gong Zhu (拱猪, Chase the Pig), is a variance of the Hearts game. It is a 4 player card game with the aim to earn the highest amount of points. You may read more about it ...
8
votes
0answers
115 views

Find a way to determine to which fibonacci squares a given coordinate belongs [closed]

Given a random coordinate (x,y), determine in which square (squares are referenced by their sidelength) it is (or the borders of which squares). The squares are drawn in a counter clockwise direction,...
17
votes
4answers
559 views

You are given a string to make and starting with the empty string, make it using appending and cloning cost

Your task is to create the given target string. Starting with an string that is empty, you will have to add characters to it, until your string is the same as the one we want. You can either add a ...
9
votes
24answers
892 views

Multiplicative undelta

Let us define the "multiplicative deltas" of values \$[\; a_0, \cdots a_N, \;]\$ as: $$ [\; a_1 / a_0, \cdots, a_{i+1} / a_i, \cdots, a_N / a_{N-1} \;] $$ The reverse operation - namely "...
10
votes
5answers
267 views

Amidakuji (阿弥陀籤) simplification

If you have ever had any exposure to Japanese or East Asian culture you will have surely encountered the Amidakuji game: As Wikipedia explains, it is a type of lottery drawn on paper and used to ...
-3
votes
0answers
30 views

Tower of Hanoi Solver [C++] [duplicate]

This question has been answered previously onTower of Hanoi Solver in all major computer languages. But i couldn't find C++. So can anyone write in C++? The Tower of Hanoi (also called the Tower of ...
13
votes
16answers
776 views

Length of a UTF-8 byte sequence

Determine the length of a UTF-8 byte sequence given its first byte. The following table shows which ranges map to each possible length: ...
13
votes
15answers
1k views

Logic Gates Manually

Make a program that simulates the basic logic gates. Input: An all-caps word followed by 2 1 digit binary numbers, separated by spaces, such as OR 1 0. The gates <...

15 30 50 per page