All Questions

28
votes
16answers
960 views

Marquee sign letters

Each day you put up a new word on a marquee sign with movable letters, buying just the letters you need to write it. You re-use letters you've bought for earlier words whenever possible. Given the ...
0
votes
0answers
51 views

Intercommunication between threads [on hold]

so glad i found this cool site. wanted to try sharing a coding challenge a friend gave me, an interview question. usually it is written in java, but you can use whatever language you want, just have ...
3
votes
5answers
228 views

Draw the Easter Bunny

This happy individual is known in folklore as the Easter Bunny. Colours It is created using 4 colours: Light pink Dark pink White Black (I'm happy for these colours to be approximated in your ...
11
votes
9answers
1k views

New Order #6: Easter Egg

Introduction (may be ignored) Putting all positive integers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
0
votes
0answers
59 views

How many mentees can be met in 24 hours? [on hold]

You've got several mentees that you need to meet with on some day and they've all given you a potential block of time they can meet. You've been given two arrays, one with the start times (as "s") and ...
-3
votes
0answers
66 views

Intel prefixes instructions, checking optimisations problems [on hold]

I wanted to learn more on ptrace's functions with x86_64 binaries, disassembling instructions. The goal is to check if a byte is one of instructions prefixes. I found some information in the Intel® ...
23
votes
11answers
2k views

The Nth Gryphon Number

I came up with a series of numbers the other day and decided to check what the OEIS number for it was. Much to my surprise, the sequence did not appear to be in the OEIS database, so I decided to ...
23
votes
20answers
1k views

Maximum summed subsequences with non-adjacent items

Introduction: Inspired by these two SO questions (no doubt from the same class): print the elements in the subarray of maximum sum without adjacent elements java and Maximum sum of non adjacent ...
32
votes
21answers
4k views

Amount of permutations on an NxNxN Rubik's Cube

Introduction: A 3x3x3 Rubik's Cube has \$43,252,003,274,489,856,000\$ possible permutations, which is approximately 43 quintillion. You may have heard about this number before, but how is it actually ...
8
votes
10answers
468 views

A Megachess Board

You want to create a square chessboard. Adjacent tiles must alternate black and white like a standard chessboard, and the bottom left corner can be either black or white. Your program will take in ...
41
votes
46answers
5k views

Generate an RGB colour grid

This! is an RGB colour grid... Basically it's a 2-dimensional matrix in which: The first row, and the first column, are red. The second row, and the second column, are green. The third row, and the ...
23
votes
21answers
2k views

Fundamental Solution of the Pell Equation

Given some positive integer \$n\$ that is not a square, find the fundamental solution \$(x,y)\$ of the associated Pell equation $$x^2 - n\cdot y^2 = 1$$ Details The fundamental \$(x,y)\$ is a pair ...
33
votes
6answers
2k views

List of Python versions

Python is the fastest-growing major programming language today. It is the most wanted language for the third year in a row, meaning that developers who do not yet use it say they want to learn it. [1]....
11
votes
12answers
1k views

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Your goal is to write a program that takes no input and outputs the following text: ...
33
votes
21answers
3k views

List *all* the tuples!

Write a program, given an input n, will generate all possible n-tuples using natural numbers. ...
25
votes
12answers
1k views

Letter Boxed validator

The New York Times has a daily online game called Letter Boxed (the link is behind a paywall; the game is also described here), presented on a square as follows: You are given 4 groups of 3 letters (...
8
votes
6answers
1k views

Area of a 2D convex hull [closed]

You are given an array/list/vector of pairs of integers representing cartesian coordinates (x, y) of points on a 2D Euclidean plane; all coordinates are between −104 and 104, duplicates are allowed. ...
-5
votes
0answers
51 views

How can i merge multiple images woth Python given the opacity of each one? [closed]

This is for a project. I have a list of the different opacities and a list of the RGB for example [0.2 , 0.15, 0.05, 0.3, 0.2] for the opacities and [(100,0,2) ,(200,100,1),(15,34,222),(123,213,22),(...
16
votes
5answers
621 views

New Order #5: where Fibonacci and Beatty meet at Wythoff

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
18
votes
13answers
2k views

Stars Make Stars

Introduction The idea is to use the asterisk character (star) * to display an ascii-art star at a specified dimension. The dimension is an input number greater ...
21
votes
12answers
1k views

Slither Like a Snake

The Idea We've done matrix spirals before, and full rotations, and even diagonal rotations, but not, as far as I can find, snake rotations! What is a snake rotation? Imagine the rows of a matrix ...
-4
votes
0answers
40 views

Delete a node in the link list [closed]

I am doing my assignment where I was asked to create a menu driven dictionary in which a user can enter or remove the word. I have created the method however, for removing method it checks for the ...
-1
votes
0answers
48 views

java puzzle 2D grid and scanner [closed]

A farmer wants to reorganize the crops growing in his farm. The farm is in the form of an N X M grid with each cell in the grid being a square plot. Each plot has to be planted with a variety of crop. ...
20
votes
11answers
770 views

Adventurers in the Ruins

Test Driver • Challenge Discussion • Submit Adventurer (Image Source) Several rival adventurers are raiding the ruins for treasure, but they can only carry so much at a time and have their ...
30
votes
48answers
4k views

Simulating Exploding Dice

Your task is to make a program that takes in an integer n > 1, and outputs the roll of a single n-sided die. However, this ...
29
votes
20answers
2k views

Make it rain characters

Inspired by this chat mini-challenge. Given a string as input (ASCII printable characters only), output the string with the letters "raining" down. Each letter must be a random number of lines ...
19
votes
2answers
494 views

Can a neural network recognize primes?

Background Recognizing primality seems like a poor fit for (artificial) neural networks. However, the universal approximation theorem states that neural networks can approximate any continuous ...
19
votes
15answers
2k views

Match Roman Numerals

Challenge Given some input string, return a truthy value if it represents a correct roman numeral between 1 (=I) and 3999 (=...
14
votes
14answers
1k views

Multiply Two Integer Polynomials

Your task is to take two single-variable integer polynomial expressions and multiply them into their unsimplified first-term-major left-to-right expansion (A.K.A. FOIL in the case of binomials). Do ...
35
votes
14answers
3k views

Worn-tile Scrabble

Problem You're stuck in a cabin in the middle of the woods, with only an old scrabble set to entertain yourselves. Upon inspection you see that the scrabble letters are so worn, that only the points ...
0
votes
0answers
80 views

Output the Missing Character [duplicate]

When writing a programm 1 missing character can ruin everything, wouldn't it be great if the programm told you what was missing ? Task: Create any (non Empty) programm, that takes no input and ...
34
votes
24answers
4k views

Output the Arecibo Message

The Arecibo message is a 1974 interstellar radio message carrying basic information about humanity and Earth sent to globular star cluster M13 in the hope that extraterrestrial intelligence might ...
27
votes
13answers
2k views

Pristine Bit Checking

Write a program/function that takes two integers in the range \$0\$ to \$255\$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different. For example, \$1\$ and \$...
17
votes
19answers
2k views

New order #4: World

Introduction (may be ignored) Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all ...
43
votes
40answers
9k views

Patience, young “Padovan”

Everyone knows the Fibonacci sequence: You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle....
11
votes
11answers
502 views

Simulate Bitwise Cyclic Tag

Challenge Given two strings in any default I/O format, do the following: NOTE: The challenge will refer to the first string as the "data" and the second referred to as the "program". Change the ...
10
votes
3answers
643 views

How long does it take to type this?

Introduction I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a ...
10
votes
4answers
289 views

String Manipulation Interpreter

Summary A new string manipulation language has been made, using only the characters $+#-!*|@>! Your task is to implement an interpreter for it in as few bytes ...
4
votes
18answers
901 views

To string or not to string

Given an input string, output at random the unique combinations with repetition of the characters in the input string, from length 1 up to the length of the input string, with an equal chance of each ...
9
votes
0answers
183 views

Solve Subset-Sum in polynomial time (…if P = NP)

Shocking news: Dr. Mad J Scientist has released a proof of P = NP to the world. But the proof is nonconstructive, and she's keeping the algorithm to herself. Worry not. Without even looking at her ...
15
votes
9answers
606 views

Roll the carpet

This question is inspired by Kevin Cruijssen's question. Now that the carpet is laid out, we want to roll it. Your task is to write a program that takes a string and returns a spiral made from this ...
0
votes
0answers
97 views

Compute the order of a Rubik's Cube cycle without trivially counting them [duplicate]

On a Rubik's Cube, performing a particular sequence of moves repeatedly will always return it to its original state. Your job is to figure out the "order" of a particular sequence of moves, that is, ...
0
votes
0answers
48 views

Fizz Buzz game code golf [duplicate]

In the game Fizz Buzz, players generally sit in a circle. The player designated to go first says the number "1", and each player thenceforth counts one number in turn. However, any number divisible by ...
1
vote
0answers
42 views

Count using letters [duplicate]

What to do? Starting from a, count in the sequence: ...
33
votes
14answers
2k views

Today is the Center

Given a date as input in any convenient format, output a calendar with that date as the exact center of a five-week window. The header of the calendar must include the two-letter abbreviations for the ...
19
votes
10answers
473 views

Reorder a Master List Based on a Reordered Subset

I recently had a problem to solve at work where I had two lists: a master list, and a smaller list that contains a subset of the items in the master list potentially in a different order. I needed to ...
17
votes
16answers
2k views

Do I have a twin with permutated remainders?

We define \$R_n\$ as the list of remainders of the Euclidean division of \$n\$ by \$2\$, \$3\$, \$5\$ and \$7\$. Given an integer \$n\ge0\$, you have to figure out if there exists an integer \$0<k&...
3
votes
0answers
119 views

Minimum cost of solving the Eni-Puzzle

You're tasked with writing an algorithm to efficiently estimate cost of solving an Eni-Puzzle from a scrambled state as follows: You're given m lists of containing n elements each(representing the ...
28
votes
26answers
4k views

Arrow those variables!

Challenge Robin likes having his variables declaration in the shape of an arrow. Here's how he does it: Input any number of strings Order them by ascending length Output them ordered by the middle ...
10
votes
5answers
468 views

Valid term from quadratic sequence?

You are given four numbers. The first three are \$a\$, \$b\$, and \$c\$ respectively, for the sequence: $$T_n=an^2+bn+c$$ You may take input of these four numbers in any way. The output should be ...

15 30 50 per page