instruction stringlengths 34 53.1k |
|---|
In Applied Cryptography by Bruce Schneier (which I have been reading quite a lot recently), a protocol for splitting secrets is discussed. Here is a brief description:
Trent generates a random byte string, R, the same length as the message, M.
Trent XORS M with R to make S.
He gives R to Alice and S to Bob.
Your ... |
Just curious if someone can provide a short example of code that causes a compiler's optimizer to behave incorrectly:
without optimization (or at lower optimization), code takes X seconds to run
with optimization (or at higher optimization), code takes Y seconds to run where Y > X
In other words, the optimizer's cost... |
The Challenge
Given an integer, calculate its score as described below.
The score is calculated by raising each digit of the input Integer to the power n, where n denotes the index of the digit in Input (beginning with 1) when counted from left to right (the index of leftmost digit should be 1), and then summing them a... |
In the Thai calendar the year 2017 corresponds to 2560. The Thai calendar is always 543 years ahead of the Gregorian calendar.
Observant coders will note that 2560 is equal to \$2^9 \times 5\$, in other words it has 10 prime factors. This will not happen again for another 896 years! We call a year tenacious if it has e... |
Challenge
Given a graphical input of a shape, determine how many holes there are in it.
Not Duplicate
This question was marked as a possible duplicate of Count Islands. I believe this challenge is different from the Count Island challenge because in this one, you have to figure out how to eliminate blocks that touch th... |
The Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different.
Let P be a binary string of length n and T be a binary string of length 2n-1. We can compute the n Hamming distances between P and every n-length substring of T in order from left to ri... |
In March 25, 1821, Greece fought its great war of independence. In order to honor this, your task is to print the Greek national anthem:
Σε γνωρίζω από την κόψη
του σπαθιού την τρομερή.
Σε γνωρίζω από την όψη
που με βιά μετράει τη γη.
Απ' τα κόκκαλα βγαλμένη,
των Ελλήνων τα ιερά!
Και σαν πρώτα ανδρειωμένη,
χαίρε ω χαίρ... |
Introduction
Suppose you want to compute the tail maxima of a list of numbers, that is, the maximum of each nonempty suffix.
One way to do it is to repeatedly choose one number and replace it by a higher number occurring after it, until this is not possible anymore.
In this challenge, your task is to perform one step o... |
Sometimes, when I'm idly trying to factor whatever number pops up in front of me¹, after a while I realize it's easier than I thought. Take 2156 for example: it eventually occurs to me that both 21 and 56 are multiples of 7, and so certainly 2156 = 21 x 100 + 56 is also a multiple of 7.
Your task is to write some code ... |
If you're like me (and/or use Windows), You should have found this issue quite disturbing.
You plug in a hard drive (2TB for my occasion), and realize it doesn't show as 2TB, but a bit smaller size which is clearly not 2TB.
Over some research, I found it was because of Microsoft's mistake. Mistyping Binary prefix as De... |
Write a program to determine if a periodic sequence of positive integers has the property that, for every integer n occurring in the sequence, there are never more than n other integers between two consecutive occurrences of n.
For example, 2, 3, 5, 2, 3, 6, 2, 3, 5, 2, 3, 6, ... does have this property: every pair of ... |
Alright, my second attempt at a code golf, let's see how this goes.
Pretend you have a 3x3 grid of digits, from 0 to 8:
0 | 1 | 2
---+---+---
3 | 4 | 5
---+---+---
6 | 7 | 8
Return the neighbors the input has as indexes of the array.
Rules:
It's code golf, so shortest answer wins.
The pretend array's index can sta... |
The beloved fish who swims through the code of ><> (an esoteric programming language) has been taken out of its natural environment. This change has rendered it incapable of moving around in the way it's used to: what used to be toroidal movement has been restricted to simple left-to-right movement. But ><> programs ar... |
I am too bored and want a challenge to solve. But I do not see any interesting challenges, and I am too lazy to search for one. Can you (Well, technically your code) suggest me one?
I/O
Input: None.
Output: A link to a random open(i.e. non-closed) challenge("Challenge" excludes tips!) on PPCG. You may not link to an a... |
March 13 is recognized as National Jewel Day, which is the theme of this challenge. So, given an integer n where n is greater than 0, create an ASCII jewel. For example:
n = 1 n = 2 n = 3
______
____ / \
__ ... |
The subfactorial or rencontres numbers (A000166) are a sequence of numbers similar to the factorial numbers which show up in the combinatorics of permutations. In particular the nth subfactorial !n gives the number of derangements of a set of n elements. A derangement is a permutation in which no element remains in the... |
It's the final sprint... and half your team is off ill. You're working late, just making your last commit for the day, looking forward to... why have the lights turned off? I don't remember the security guy coming around... oh no! I left my keys at home!
As the horror of the situation sinks in, you decide that you are ... |
Rules
No cell range references (A2:B3).
Maximum 9 rows and 9 columns.
No circular references or formula errors.
Empty cells evaluate to 0.
Data are numbers only, but may be taken as strings.
Formulas are strings.
Implementation choices
You must state your choices in these matters:
Require formulas to be prefix... |
This challenge, while probably trivial in most "standard" languages, is addressed to those languages which are so esoteric, low-level, and/or difficult to use that are very rarely seen on this site. It should provide an interesting problem to solve, so this is your occasion to try that weird language you've read about!... |
You're with your best bud, Jim, at the amusement park and as your favorite ride comes into view, you and Jim exchange glances. Naturally you race to get in line. Unfortunately he wins because you're a golfer and he plays a real sport (sorry friends). In fact, you're so far behind that you and Jim are separated by x peo... |
There has recently been a big snow, and my driveway needs snow-blowing. If the snow-blower goes over some area that it has already snow-blowed, then that area will have snow blown onto it and need to be blown again. And of course, the snow-blower cannot start in the middle of the driveway, it needs to start from my gar... |
This is the second in a series of Island Golf challenges. Previous challenge
Two hermits have arrived on a desert island. Since they came seeking solitude, they wish to live as far away from each other as possible. Where should they build their huts to maximize the walking distance between them?
Related reading
Input
Y... |
You will be given a string. It will contain 9 unique integers from 0-9. You must return the missing integer. The string will look like this:
123456789
> 0
134567890
> 2
867953120
> 4
|
Specifications
Your program must can take in an integer n, then take in n more strings (containing only alphanumeric characters) in your preferred method (separated by whitespace, file input, hash table etc.). You must then find the permutation before the inputted strings when sorted in lexicographical order, and outpu... |
Consider the 74 characters from the 2016 time capsule string (note the leading space):
!!!!!#$$%&())))*+...1449:=@@@AHILOQQQTTZ\\^`````````eefmpxy{||||~~~~~~~~~
Your task is to write as many programs as possible (in the same language) using these characters. The output of each program must be nonempty. When all of th... |
On 4chan, a popular game is get. Every post on the site gets a sequential post ID. Since you can't influence or determine them, people try to guess (at least a part of) their own post number, usually the first few digits. Another version of the game is called dubs, and it's goal is to get repeating digits at the end of... |
Röda is a stream-based scripting language created by fergusq.
What general tips do you have for golfing in Röda? I'm looking for ideas that can which can be applied to code-golf problems and which are also at least somewhat specific to Röda (e.g. "remove comments" is not an answer).
Please post one tip per answer.
|
Your objective: Given a string of brackets, output the minimum Damerau-Levenshtein Distance required to turn the input string into a string where the brackets are balanced.
Input
The input string will only contain brackets and no other characters. That is, it is a combination of any of the characters in (){}[]<>. You m... |
In the game 2048, you have a grid, and you can move the elements in four directions. They all move in that direction as far as they can. For this challenge, you will be given a padded, square 2D string (either with newlines, or a list of strings), like so:
ab cd e
f ghij
kl
mno p
q r st
u v
w x y
... |
Meta-background
This was set as a question on Puzzling, and the instant reaction was "well, someone will just solve that by computer". There was a debate about just how complex a program to solve this would have to be. Well, "how complex does this program have to be" is pretty much the definition of code-golf, so maybe... |
Given a string of digits or an integer as input, you will have to indexize it.
This is how you modify the input. We will use 30043376111 as an example:
First, find the sum of the indices of each occurrence of the respective digits:
0: 1 + 2 = 3
1: 8 + 9 + 10 = 27
3: 0 + 4 + 5 = 9
4: 3
6: 7
7: 6
Then, construct a new... |
Background
By expanding and cancelling terms, it is easy to show the following identity:
However, it is an open problem whether all 1/n-by-1/(n+1) rectangles can tile the unit square.
The Task
Your program should take a positive integer N as input in any convenient manner, and pack all 1/n-by-1/(n+1) open rectangles w... |
This is the first in a series, the second is Two roads diverged in a yellow wood (part 2)
This challenge is inspired by Robert Frost's famous poem, "The Road Not Taken":
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
... |
The Program
You are given two strings, A and B. A is the current position at which your timer is at, and B is the position at which your timer will stop. Both strings are in the format m:ss. You must write a program that determines the amount of time left which should also be formatted as m:ss or mm:ss.
Example
0:00 0:... |
Background
The Schläfli Symbol is a notation of the form {p,q,r,...} that defines regular polytopes and tessellations.
The Schläfli symbol is a recursive description, starting with a p-sided regular polygon as {p}. For example, {3} is an equilateral triangle, {4} is a square and so on.
A regular polyhedron that has q r... |
Given the state of a square Game of Life grid, determine whether it could have evolved from any previous state, or could only have been created. That is, identify whether the state is a "Garden of Eden" state.
Input
A square grid of states, with 1 indicating "alive" and 0 indicating "dead". You may choose any two disti... |
It seems that any Simple Modification of deltas using a consistent function can almost always be done some other shorter way, Dennis.
Thus, the only solution I can imagine to make this harder, is to introduce some sort of inconsistent function.
Sorting.
Your task is to take an array of integers, sort their deltas, and ... |
Note this is a question primarily focusing on data-structures
Introduction
Bacefook wants people to be friendlier! As such, they are implementing a new system to suggest friends! Your task is to help Bacefook to implement their new suggesting system.
Specifications:
Your program must be a REPL (read-eval-print loop) su... |
Your task is to write a program, which takes a binary input and converts it to plain text. For Example:
01100001 01100010 01100011 = "abc"
Rules
Input can come from STDIN, function arguments, command line argument, file, whatever suits you.
The program can be a function, full program, whatever works, really, as long... |
This is the second in a series, the third is Two roads diverged in a yellow wood (part 3)
This is based on Two roads diverged in a yellow wood (part 1), a previous challenge of mine. It was fairly well received, but it was also fairly trivial (a Java answer in 52 bytes!) So I made something more complex...
The inspirat... |
Many applications that depend on network resources (such as games connecting to game servers) do not allow the user to set a proxy. There are a lot of ways to force the usage of a proxy regardless, I personally have always been a fan of a local SOCKS tunnel.
What's that?
Instead of connecting directly, an application o... |
Given an image, either as input (possibly in RGB triplets) or with the filename as input (you may assume the image has a specific filename, possibly without an extension), output an image representing a single color channel of the image.
You will also take another input, representing which channel to output. The input ... |
Note: This is based on Two roads diverged in a yellow wood (part 2), a previous challenge of mine. Because of the popularity of that question and Two roads diverged in a yellow wood (part 1), I wanted to make a third. But the first 2 were too easy (a 2-byte answer on the first, a 15-byte answer on the second.) So I ma... |
Standardized testing usually comes with a scan-tron or some type of answer document that records your answer. A computer or human(s) would then check your answers and determine your grade. So here, given a scan-tron and the answer key, determine the score and questions missed if any. A scan-tron is just a document with... |
Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.
Rules:
The program must generate one side of the Koch snowflake to the nth depth.
Output must be ASCI... |
Note: this is my first post here.
The Challenge
The challenge is to count the number of chocolate chips in a cookie. A cookie in this case is a circle with dots (the chips) in it. Given any square cartoon image of this cookie, you are to write a bot that counts and outputs the number of chocolate chips.
Rules
Has to t... |
We know that f is a polynomial with non-negative integer coefficients.
Given f(1) and f(1+f(1)) return f. You may output f as a list of coefficients, an ASCII formatted polynomial, or similar.
Examples:
f(1) f(1+f(1)) f
0 0 0
1 1 1
5 75 2x^2 + 3
30 3904800 4x^4 + 7x^3 + 2x... |
How many of you that still use your own knuckle to determine whether a month is having a full 31 days or less?
You job is to write a program to count how many months, in a month range, are having a full 31 days and how many are having less than 31 days by "counting the knuckles".
Courtesy: amsi.org.au
Input
A pair of... |
We define a binarray as an array satisfying the following properties:
it's non-empty
the first value is a 1
the last value is a 1
all other values are either 0 or 1
For instance, the array [ 1, 1, 0, 1 ] is a valid binarray.
The task
Given a non-empty array A of non-negative integers and a positive integer N, your jo... |
(There are related questions about infinite sandpiles, and finding identity elements of sandpiles.)
Given a matrix of non-negative integers, return a matrix of the same dimensions, but toppled:
If the matrix doesn't contain any values larger than 4, return it.
Every "cell" that is larger than 3 gets reduced by 4, and ... |
The sound of the theremin has been immortalized in The Beach Boys song Good Vibrations. Many also associate its sound with the theme for the original series of Star Trek, though apparently it was a soprano's emulation.
This challenge requires you to implement a theremin.
Input
Take 2 dimensional input from a mouse or... |
Note: There was not a vanilla challenge to actually flip a coin, even though there were mentions about flipping coins a lot of places. Even though there is a challenge to generate a random number from 1 to N, I suspect this is not a dupe. These questions ask for random numbers from 1 to N, while this ask for just trut... |
Challenge
Given a (floating-point/decimal) number, return its reciprocal, i.e. 1 divided by the number. The output must be a floating-point/decimal number, not just an integer.
Detailed specification
You must receive input in the form of a floating-point/decimal number...
...which has at least 4 significant digits o... |
A fun game to play if you are bored is the Diffy Game. It is a one player game that is pretty simple and can consume a good deal of your time.
The Diffy game works like as follows: You start with a list of non-negative integers, in this example we will use
3 4 5 8
Then you take the absolute difference between adjacen... |
The user will hide, and the computer will try to find them.
First, the program will take an input, for the size of the grid. Like 5x5, 10x10, 15x15, etc. The grid won't always be a perfect square.
The grid is sort of like a chessboard:
_______________________________
| | | | | |
| A1 | | | ... |
Usually to run multiple commands consecutively one would do:
sudo apt update && sudo apt upgrade # 35 characters
I can't help but feel there's a neat trick to running these with less keystrokes, and you golfers here love challenges :)
I've found a ton of answers around various SE Sites related to running arguments to ... |
Task
Everyone knows the game "Tic-Tac-Toe". Your task is it, to evaluate an ascii tic-tac-toe matchfield. Your Programm/Function should output/return the winner: O, X or nobody (N).
Pattern
X|O|X
O|X|O
O|O|X
In this case your programm/function should output/return 'X'
Rules
Input can come from STDIN, function argumen... |
This is a fairly simple challenge.
Write a program that computes the distance between two points on a 2D plane. However, you can't use any functions or operators (referred to here as symbols) that are 1 character long.
Examples:
-=, +=, *=, /=, %=, etc. are allowed.
||, &&, --, ++ are allowed as well.
+, -, /, * are n... |
Your challenge is to print/output/return this text:
_____ _____
| 1 | | 2 |
| H | ... |
Today, as I'm writing this, is March 31st. In the US, this is 3/31. I was playing around with 331 as a number to come up with a challenge, and found that its residues (modulo small numbers) is palindromic. 331%2=1, 331%3=1, 331%4=3, 331%5=1, 331%6=1 (11311).
Your challenge here is, when given an integer n > 2, output t... |
Because it's Saturday (UTC) and I'm hungry, I would like a slice of pizza. I will give you an order and I would like a nice hot ascii-art pizza. Up to the challenge?
The Drive-Thru
I'll place my order wherever your drive-thru is, whether it is STDIN, a function parameter, a command-line argument, but I'm not going to p... |
Each March in the United States, the NCAA holds a 68-team tournament for both men's and women's college basketball. Here's what the bracket looks like:
There are four regions, each with 16 teams seeded from 1-16.
Each region is seeded the same way, and across the four regions, the same matchups occur between seeds. Fo... |
In this challenge, you'll get four different but somewhat related tasks that must be solved in a specific manner. First, I'll explain the tasks, then follows an explanation of how you must solve it.
Your code should for all four tasks take two positive integers as input: n,m, where n<m. All tasks must be solved in the ... |
Challenge
Given two numbers, output their quotient. In other words, integer divide one number by another.
Both divisor/dividend will be under 10001. Division must be performed using integer division, rounding down.
Here are some example inputs and outputs:
5 1 5
-4 2 -2
4 -2 -2
6 ... |
To-Do: Come up with a Better Title
Specification:
This challenge is similar to kolmogorov-complexity, but with a twist. You goal is to output a finite string that resembles the following string of psuedo-random characters as closely as possible:
BABBBBAAABBAABBBBAABBBAABBBABBAABABABBBBABBBBBBAABABBAABABBBABBBABAAAAABA... |
Given a string of ASCII art like such (This isn't ASCII art but it will do for the example):
abc
d e
fgh
Jumble it as if it was being displayed on a screen with one character per line, like so:
a
b
c
d
e
f
g
h
Print the result, wait one second, ±0.5 seconds before clearing the terminal and the print the same thing, ... |
Introduction
A queue is an abstract data type where elements are added to the front (enqueue) and removed from the back (dequeue). This is also known as the FIFO (First In First Out) principle.
It is best shown with an example:
Challenge
Given a non-empty array that contains positive integers and elements that indica... |
On most new-years challenges when it is currently not the corresponding year of the challenge, It says this in the front.
It's [current year] already, folks, go home.
You have to output this text with the current year substituted.
I/O
Input: None.
Output: It's [current year] already, folks, go home.
|
Very few, if any, programs or applications have utilised the proposed spec for WOM which was initially thought up in the early 1970s as a polar opposite to ROM, so your task is to take a dataset of n Integers and simulate storing it to a WOM schema as a proof of concept.
Your array must contain 1 or more integers. Smal... |
Chess is a game with 6 different types of pieces that can move in different ways:
Pawns - They can only move up or capture diagonally (also forward). Capturing a piece behind them or beside them is illegal. The only exception is en passant. For this challenge, if a pawn reaches the 8th rank (or row), assume it become... |
Note to Moderators and editors:
This post's title is for effect and should not be changed. The misspelling is intentional and part of the challenge.
Backstory
The (stereo)typical bad SO question asks something along the lines of "plz send teh codez!" In other words, it asks someone to do the work for the asker and ... |
Introduction
You may know and love your normal unit circle. But mathematicans are crazy and thus they have abstracted the concept to any point that satisfies x*x+y*y=1. Because Cryptographers1 are also weird, they love finite fields and sometimes finite rings (it is not like they have much choice though), so let's comb... |
Input: a sequence of uppercase letters (ASCII [65;90]) which is the Nth* lexicographical permutation of the multiset of its characters
*permutations are numbered from 0 or 1 upwards
Output: base-10 integer N
Rulez
There might be duplicates (that's how this challenge differs from
this one)
The characters are ordered b... |
Your challenge is simple: write a program or function which appears to print the first ten numbers of any integer sequence (on OEIS, the answerer may choose which sequence), but instead prints the exact text:
Happy April Fool's Day!
if and only if it is run on April 1st of any year. Run on any other day should make it... |
Note: The winning answer will be selected on 4/12/17 the current winner is Jolf, 1 byte.
I'm surprised that we haven't had a what's my middle name challenge on this site yet. I did alot of searching but found nothing. If this is a dup, please flag it as such.
Your challenge
Parse a string that looks like Jo Jean Smit... |
In this challenge we try to solve two important problems at once. They are:
Given integers \$a\$ and \$b\$, tell if \$a^b-1\$ is a prime number.
Given integers \$a\$ and \$b\$, return \$a\choose b\$.
Specifically, you must write two programs, one that does the first task and one that does the other. As we want to sol... |
The pigeonhole principle states that
If N items are put into M boxes, with N > M, then at least one box must contain more than one item.
For many, this principle has a special status compared to other mathematical enouncements. As E.W. Dijkstra wrote,
It is surrounded by some mystique. Proofs using it are often rega... |
Well, Brexit happened. And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus.
Your job is to do something similar. The UK leaves the the EU on 31st of March 2019 and you have to create a digital countdown for this that changes every second (with a 0.05 second deviation allo... |
Input:
2 numbers, x and y.
Output:
Output a text block where x is the width of the text block and y is the height of the text block. Then there will be a straight line going from the top left to the bottom right and to show it, there should be a # where the line should cross.
The # should be generated using the straigh... |
Perfect License Plates
Starting a few years ago, I made myself a little game while driving around: checking if nearby license plates are "perfect". It's relatively rare, but exciting when you find one.
To check if a license plate is perfect:
Sum up the characters, with A = 1, B = 2, ... Z = 26.
Take each consecutive... |
Challenge:
Output the 'integer-digits' of one of the following six arithmetic-tables based on the input:
- addition (+);
- subtraction (-);
- multiplication (*);
- division (/);
- exponentiation (^);
- modulo operation (%).
Rules:
What do I define as 'integer-digits': Every result of the arithmetic operand which is ex... |
Task: Crack the scrambled code for multiplying the square root of an integer n by the square of it!
You must post a comment in the cops' thread with a link to your working source, mentioning clearly that you have Cracked it. In your answer's title, you must include the link to the original answer.
Rules:
You may only ... |
Note: This is the cops' thread, where one should post the scrambled code. Here is the robbers' thread where the cracked source should be posted and linked to the cop's answer.
Task: Write the shortest safe program which multiplies the square root of an integer n by the square of n
This is cops-and-robbers, so the rule... |
Am I under Budget?
Every 2 weeks when I get my cheque, I allocate a certain amount to last me until my next cheque, and bank the rest. To figure out how much I can spend per day and still remain under/on budget, I just need to divide the allocated amount by the number of days it needs to last me.
On Day 1 if the budget... |
I need this down to as few characters as possible. I would use Test-NetConnection but I need PSv2 compatability. Any help would be appreciated.
$socket = new-object Net.Sockets.TcpClient
$socket.Connect("192.168.5.5",445)
$socket.Connected
As a note I have tried this but it doesn't work
(new-object Net.Sockets.TcpCl... |
Piet is an interesting programming language for a number of reasons. Today we will focus on one reason: the roll command. The roll command was originally from PostScript and is a powerful way to manipulate the stack.
The roll command pops the top two elements of the stack and uses them as parameters. We'll call the fir... |
On the advice of Ms. Pac-Man who's worried about him getting overweight, Pac-Man has decided to keep track of his daily Pac-Dot intake. Help him count the number of Pac-Dots on a given path in the maze!
The maze
To help you build your own encoding of the maze, you can get some raw data here.
Pac-Man's journey
In the c... |
Did you notice, that this is a palindrome?
Input
Non-negative integer number or string representing it
Output
4 possible outputs, representing two properties of number:
is it palindrome
tricky #2
Tricky #2 property
If number is not palindrome, this property answers the question "Do the first and the last digits have... |
Task
Read in a possibly infinite text stream or file, outputting its contents until the word hello has been output, abiding to the following rules.
Once hello has been output, your code should quit immediately. It should not wait for a newline for example.
Your code should output as it goes. That is it shouldn't read ... |
The Manhattan distance on a regular grid is the number of orthogonal steps one needs to take to reach one cell from another. Orthogonal steps are those that go through the edges of the grid cells (as opposed to the corners, which would give us the Chebyshev distance).
We can define a similar distance on other grids, fo... |
Alice, Bob, Carol, Dave, and Eve are going out for a nice game of golf and need your help to decide in what order they will play.
Your program will input some statements, which are defined as a condition, and then one or more optional logical boolean operators followed by another condition. (That's [Condition]([Logical... |
Introduction
It was just a normal day, here at your military base. Suddenly, you looked up to see a bomb falling down from the sky! You need to create a program to predict where it will fall, and tell you the location.
Challenge
You will be given a bomb in the form of Start-X Start-Y X-velocity Y-velocity. You can assu... |
Background
The language BrainF*** (or simply BF), is an extremely minimal programming language. We're going to strip it back even further by eliminating IO operations; only the sub-langage defined by the operations +-<>[], henceforth referred to as BF-subset, shall be used. The BF variant considered has a tape extendin... |
Example run added 4/11
Rules Clarification 4/8: All submissions will be competing in one giant free-for-all tournament consisting of as many matches as my computer can perform in 48 hours.
Anyone who's spent any time watching streams on Twitch is aware of the prevalence of DeepBot, and is perhaps even familiar with its... |
Sometimes I find myself wanting a hot dog (don't we all) and so I make one. Now to make a hot dog, it is very simple.
1) Put the hot dogs into boiling water
2) Wait for a certain amount of time (detailed below)
3) Eat the hot dog once the time has elapsed.
You may have noticed that I said
certain time (detailed below... |
Given two permutations in disjoint cycle form, output their product/composition in disjoint cycle form.
To find the composition, convert the disjoint cycles to permutations in two-line notation. Each number in a disjoint part of a cycle is mapped to the number following it in the same part. It wraps around. So 1 -> 5,... |
The dealer has been sloppy and lost track of what cards his/her deck contains and what cards are missing, can you help him/her?
A complete deck consists of 52 playing cards, namely:
Each color in the deck (hearts, diamonds, spades, clubs) contains:
The numbers [2 - 10]
A Jack
A Queen
A King
An Ace
Task
Your program... |
Disclaimer: This isn't my challenge but ThisGuy said I was OK to post.
Occasionally I want to make a word into it's opposite, like happiness goes to unhappiness. Unfortunately when this happens, my brain will sometimes go blank. Then one day, after yet another this happening, I thought to my self "This is what program... |
Introduction
One day, you were just relaxing in your office in the CIA, when suddenly you see an alert on your computer. Your programs have just intercepted hundreds of coded messages! A quick examination reveals the rule for encoding, but you need a program in order to decode fast.
Challenge
You will be given a list... |
Challenge:
There's a silly puzzle circulating on social networks that reads:
8 + 2 = 16106
5 + 4 = 2091
9 + 6 = ?
Implement a function or operator that, when given two positive integer numbers x and y such that x > y > 0, yields the correct answer as an integer, where the answer's digits are the digits of x * y follow... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.