instruction
stringlengths
34
53.1k
In Salesforce CRM, every object has 15-character alphanumeric ID, which is case-sensitive. If anyone's curious, actually it's base-62 number. However, tools used for data migration and integration may or may not support case sensitivity. To overcome that, IDs can be safely converted to 18-character case-insensitive alp...
Two rows of a matrix are orthogonal if their inner product equals zero. Call a matrix with all rows pairwise orthogonal an orthogonal matrix. A circulant matrix is one where each row vector is rotated one element to the right relative to the preceding row vector. We will only be interested in matrices where the entries...
Introduction We've have a few base conversion challenges here in the past, but not many designed to tackle arbitrary length numbers (that is to say, numbers that are long enough that they overflow the integer datatype), and of those, most felt a little complicated. I'm curious how golfed down a change of base code like...
Challenge: Write a function or program that accepts a list of boolean values and returns all of the ranges of True's. Test Cases: f [F] = [] f [T] = [[0,0]] f [T,T,F,T] = [[0,1],[3,3]] f [F,T,T,F,F,T,T,T] = [[1,2],[5,7]]...
LOOP This challenge is based around a modified version of the programming language LOOP. A program may be of any of the following forms: P;Q, where P and Q are subprograms Subprogram P is executed, then subprogram Q is executed. x++, where x is a variable Variable names are the letter x followed by a whole number...
The scenario After a long day's work slogging in the office and browsing stackexchange.com, I finally walk out the door at 16:58, already weary with the day. Because I am still only an intern, my current mode of transportation is on bicycle. I head over to my trusty Peugeot Reynolds 501, but before I can sail away on i...
Introduction You're probably familiar with zip bombs, XML bombs, etc. Put simply, they are (relatively) small files which produce enormous output when interpreted by naïve software. The challenge here is to abuse a compiler in the same way. Challenge Write some source code which occupies 512 bytes or less and which com...
This challenge is pretty simple. As input, you take in a regular expression. Then, you output a truthy/falsey of whether or not your source code matches the regular expression. It's that simple! Just two more things: No quine builtins; you may, however, access the code's source code by file IO, etc. This is code-golf,...
Powerball is an American lottery that has recently gained attention because the current jackpot (as of January 11, 2016) is the largest lotto prize in history, at about $1.5 billion (USD). Powerball players choose 5 distinct numbers from 69 numbered white balls, and 1 one "Powerball" number from 26 numbered red balls. ...
You probably do know that the different reputation levels on Stack Exchange are formatted differently when seen from the questions page / a post. There're all the rep-formatting rules: if a user has 1 to 999 (one to three digits) rep, it's left as-is. if a user has 1000 to 9999 rep (four digits), it receives the comma...
Introduction A229037 has a quite intriguing plot (at least for the first few terms): There is the conjecture, that it might indeed have some kind of fractal property. How is this sequence constructed? Define a(1) = 1, a(2) = 1 then for each n>2 find a minimal positive integer a(n) such that for every arithmetic 3 term...
Given a string with a multiple people's investment data, find out how much profit/loss they recorded. The string only contains capital and lowercase letters, like this: AABaBbba Each letter represents a person - a capital letter means buy, a lowercase letter means sell. The price of the stock they are investing in (C...
There's a really important problem in cellular automata called the Majority problem: The majority problem, or density classification task is the problem of finding one-dimensional cellular automaton rules that accurately perform majority voting. ... Given a configuration of a two-state cellular automata with i + j cel...
Introduction This challenge consists in finding the greatest number removing y digits from the original number n which has x digits. Assuming y=2 n=5263 x=4, the possible numbers removing y=2 digits are: [52, 56, 53, 26, 23, 63] So, the greatest number is 63 which must be the output for this example. Another logic wo...
In a fictional 2D world, a set of 2D printing instructions for an object can be represented by a list of integers as follows: 1 4 2 1 1 2 5 3 4 Each number represents the height of the object at that particular point. The above list translates to the following object when printed: # # # # # ### ## ####...
Sometimes it is useful to run a math problem with multiple inputs. The goal of this challenge is to make a program that eases this task. Number-generating expressions You must support 3 types of expression: Single number generator: Very simple, just a literal number Multi-number generator: A tad more complicated. Thee...
People, it's a popularity contest, you have to do somthing cool here. Think about cool ways of breaking the code in most languages, not about validating for everyting! Initially this challenge is NOT for esoteric languages. But I didn't disabled them as I expect voters to be fair enough to downvote answers based...
I was intrigued by the design of this graphic from the New York Times, in which each US state is represented by a square in a grid. I wondered whether they placed the squares by hand or actually found an optimal placement of squares (under some definition) to represent the positions of the contiguous states. Your code...
Your goal is to map a piece of text to a sine curve of the form: a sin ( mx - b ) Where a and m are non-zero rational numbers, b is a rational number, and the calculations are in radians. It doesn't really matter where the origin of your graph is, as long as you fit all the letters in your output. Also, it must be ASCI...
Today you need to solve a very practical problem: How many loops do you need to have a certain number of sheets on your toilet paper roll? Let's look at some facts: The diameter of a bare toilet paper cylinder is 3.8cm The length of one sheet of toilet paper is 10cm. The thickness of one sheet of toilet paper is 1mm. ...
There is an existing "game" where pirates rationally divide gold coins according to certain rules. Quoting from Wikipedia: There are 5 rational pirates, A, B, C, D and E. They find 100 gold coins. They must decide how to distribute them. The pirates have a strict order of seniority: A is superior to B, who is superior...
Given two words, spoonerise them by switching their initial consonant clusters. Fewest bytes wins. plaster man -> master plan blushing crow -> crushing blow litigating more -> mitigating lore strong wrangler -> wrong strangler def ghi -> ghef di few years -> yew fears The consonants appearing before the first vowel (a...
Given an input of a list of days of the week, output the shortest sorted representation of the list. The format of the input is a string consisting of one or more of the two-character substrings Su (Sunday), Mo (Monday), Tu (etc.), We, Th, Fr, and Sa. The input may not necessarily be given in sorted order. To convert t...
Task Write a program that will output another distinct program, and so on, while using as few distinct characters (and as few bytes) as possible. For example, program 1 should output program 2, and when program 2 is executed, it should output program 3. This can be nested as deeply as needed, but must be at least 3 dis...
Time for another easy challenge in which all can participate! The multinomial theorem states: $$(x_1 + x_2 + \cdots + x_m)^n = \sum_{k_1 + k_2 + \cdots + k_m = n} \binom n {k_1, k_2, \dots, k_m} \prod_{1 \le t \le m} x_t^{k_t}.$$ The expression in parentheses is the multinomial coefficient, defined as: $$\binom n {k_1,...
The goal of this challenge is to complete a list of consecutive nested header numbers when given a start and an end. When given 1.1.1 and 1.1.5 you should generate 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5 Specific Rules Your entry must take in a start, end, and multiple optional range parameters. Parameters can be taken fo...
Challenge: Some ascii-art is a pain to make, but makes code comments easier to read, especially when the code is dense. The challenge is to make a simple tool that converts comments to simple ascii-art with arrows. The comments to modify are delimited by empty comments. For example, supposing Haskell comment syntax, co...
Newton's theory of gravitation says that the gravitational force between two point masses is F=(Gm1m2)/ r2 Where G is the gravitational constant: 6.674×10−11 N · (m/kg)2 m1 is the mass of the first object m2 is the mass of the second object r is the distance between their centers of mass Challenge You need to simul...
I've been around for a while, watching you golf and I really enjoy it. I came up with a challenge for you all so let's begin! Challenge I assume that everyone knows what Finite State Machine (FSM) is, I will edit the the description if needed. Your program will take only one input consisting in a string that represent...
A while ago I purchased a new wallet which is able to hold 8 cards (4 on both side). However, I seem to have way more cards than that and I need to make choices on which ones I want to carry with me. Some cards I use more often than others, but the cards I prefer to carry with me are not necessarily the ones I use most...
We've had a couple of challenges about the Ulam spiral. But that's not enough. In this challenge we will plot a triangular Ulam spiral (as opposed to the usual, square Ulam spiral). Here's a sketch of what the spiral looks like. As we know, the Ulam spiral arranges all natural numbers in an outward spiral, and marks o...
Inspired by this question over on Math. Let the prime factorization of a number, n, be represented as: \$P(n) = 2^a\times3^b\times5^c\times\cdots\$. Then the number of divisors of n can be represented as \$D(n) = (a+1)\times(b+1)\times(c+1)\times\cdots\$. Thus, we can easily say that the number of divisors of \$2n\$ is...
A nonogram is a Japanese puzzle game in which the goal is to draw a black-and-white picture according to a list of contiguous regions, like so: Define the nonographic magnitude of a row or column to be the number of contiguous black regions in that row or column. For example, the top row has a nonographic magnitude of...
Given an input of a string consisting entirely of qs representing quarter notes and es representing eighth notes, output the indices of the quarter notes that are syncopated. Syncopation is complex, but for the purposes of this challenge, our definition of "syncopated" will be very simple: a quarter note that starts on...
In this challenge, you will write a program which outputs a program which is the double the length of the original program. The outputted program should output a new program a program double its length. Examples If my program is a: < a > aa < aa > aaaa < aaaa > aaaaaaaa Rules No quine built-ins The original program...
About Functional-Basic Functional-Basic (FB for short) is a language that only allows numbers and lists. Basic features, such as the if statement are missing in an attempt to simplify the language. Everything in this language is immutable. input is always assigned to the script input, which can be either a number or a ...
Task Read the contents of a table given a set of coordinates. Table formatting Tables will be in this basic format: |[name]|[name]| --------------------- [name]| [val]|[val] | [name]| [val]|[val] | Column names are always unique within columns. Row names are also unique within rows. This includes names that are ...
Your challenge is extremely simple. Given a year as input, print all the months in that year that will contain a Friday the 13th according to the Gregorian calendar. Note that even though the Gregorian Calendar wasn't introduced until 1582, for simplicity's sake we will pretend that it has been in use since 0001 AD. Ru...
Introduction RNA is the less famous cousin of DNA. Its main purpose is to control the production of proteins in cells through a process called translation. In this challenge, your task is to implement a part of this process where the RNA is split into codons. This challenge is thematically related, but concentrates on ...
CleverBot is a conversational AI that works fundamentally by repeating responses from real humans it has heard previously. It starts off pretty dumb, but once the database becomes (a lot) larger it begins sounding more like an actual person! How your program should work Output Hi! Receive the user's reply as a string ...
Introduction Right now I'm participating a chess tournament. I got inspired by the tournament schedule. Right now, I'm in a competition with three other players. That means with the four of us, we are playing 3 rounds. The schedule goes as following: Round 1: 1-4 3-2 Round 2: 3-4 2-1 Round 3: 1-3 4-2 This is also know...
This challenge is based on the idea of Plouffle's Inverter. Write a program in any language that does the following: Takes as input a non-negative rational number X written in decimal, for example 34.147425. Returns a mathematical expression using only non-negative integers, whitespace, parentheses, and the following ...
For this challenge, you need to print out the fingerings for various brass instruments. The notes an instrument can play (as well as their fingerings) are listed below: Cornet Baritone Trumpet Bugle French Horn Euphonium Tuba A#0 0 B0 C1 ...
You have a phone plan that lets you talk 180 minutes a day. Every day that you go over your daily limit you have to pay a fine of F = Men, where M is the number of minutes you went over and n is the number of days you have gone over (e.g if I went 20 minutes over the daily limit and it's my 2nd day going over, I have t...
John Doe used to be one of the fastest QWERTY keyboard typists in the world, but a recent head injury caused by a stampeding herd of downgoats has critically hampered his ability to type accurately. In a desperate effort to retain his reputation as a typing prodigy, he has tasked us with the creation of a spellchecker ...
The task is to display ascii table for a given array. Input The input is an 2D matrix. The matrix's row length is same with the length of an array. Alternatively, you can take input of an 2D matrix with the first row is a header. The outer dimension is the row. Example Input: [["License","2008-05-08","2009-03-11","2011...
The Sylvester-Gallai theorem says: Suppose you have a finite list of points in the plane. Suppose further that not all of those points are collinear (lie in a single line). Then there is some line containing precisely two of the points. (That is, there's some line on which two of the points lie, but not more than two.)...
Write a program or function to estimate as closely as possible the number of syllables in English words. The input list is here: 1000 basic English words. There are only 997 words because a few duplicates were removed. For each word, output a line containing the word, a comma (,), and the number of syllables and no oth...
Let z be a complex number. z is an nth primitive root of unity if for a certain positive integer n and for any positive integer k < n . Challenge Write a full program or function that, given a positive integer n as input, outputs all of the nth primitive roots of unity. You may output them in polar form (e^θi or e^iθ,...
Introduction to Bézout's identity The GCD of two integers A, B is the largest positive integer that divides both of them leaving no remainder. Now because of Euclid's property that each integer N can be divided by another integer M as follows:                                             there exist pairs u,v such that ...
Given an input of a string consisting of any message from our site chatroom taken from the list described and linked below, output either a truthy or a falsy value attempting to predict whether that message was starred or not in 50 bytes or less. You may use any truthy or falsy values, but they must be identical (i.e. ...
In this challenge, you will write a program to output how many decimal places are in the input string and trim the input if needed. Examples -12.32 2 32 0 3231.432 3 -34.0 0 -34 023 0 23 00324.230 2 324.23 10 0 00.3 1 0.3 0 0 -04.8330 3 -4.833 Rules Input will be a string which can be taken through, STDIN, f...
Palindromic prime problems are pretty common, but that's not what this question is about. In this challenge, the number doesn't have to be a palindrome, its prime factors do. Task Your code has to take a single positive integer as input. Then check if any of the permutations of the prime factors of that integer are pal...
A polynomial with coefficients in some field F is called irreducible over F if it cannot be decomposed into the product of lower degree polynomials with coefficients in F. Consider polynomials over the Galois field GF(5). This field contains 5 elements, namely the numbers 0, 1, 2, 3, and 4. Task Given a positive intege...
The residents of Flapus use a base-8 number system. The numbers are: 0 - Kuzla 1 - Ponara 2 - Boqkel 3 - Colopee 4 - Vruenat 5 - Foham 6 - Stikty 7 - Kricola For numbers over 7, the full name of the last digit comes first, followed by apostrophe and the first characters of the other digit(s), up to and including the fi...
A two-dimensional array of size n×n is filled with n*n numbers, starting from number 1. Those numbers are to be sorted per row in ascending order; the first number of a row must be greater than the last number of the previous row (the smallest number of all (1) will be in [0,0]). This is similar to the 15 puzzle. This ...
Introduction Skat is a traditional German card game for 3 players. The deck consists of 32 cards: Ace, King, Queen, Jack, 10, 9, 8, 7 in all 4 suits (Clubs, Spades, Hearts, Diamonds). In every round there one player plays solo while the other two play against him. At the start of a round each player is dealt 10 cards, ...
A simple register calculator This challenge involve a simple register calculator that works in the following way: It has some registers named A,B,C,...,Z, each of them can contain an integer, they are all initialized to 0. It executes instructions of 3 characters: The first character of any instruction is one of +,-,*...
Inspired by this question from our rivals friends over at Code Review. Definitions A super array is an array where each new element in the array is larger than the sum of all the previous elements. {2, 3, 6, 13} is a super array because 3 > 2 6 > 3 + 2 (5) 13 > 6 + 3 + 2 (11) {2, 3, 5, 11} is not a super array, becaus...
Back-story After typing up your essay on your new Macbook, you look up at the screen and realize that you typed in ten pages of gibberish! Or is it? On further inspection, you come to find that your Option key was stuck this whole time and these special Option-key characters correspond to the ASCII keys on your keyboar...
Your goal is to output all the "sides" (corners, edges, faces, etc.) of an N-dimensional unit hypercube, where N is non-negative. A "side" is defined as any (N-M)-dimension surface embedded in N-dimensional space, where 1 <= M <= N. The hypercube spans the space [0, 1] in each dimension. For example, for N=2 the square...
We all already crossed the look and say sequence, and where asked to guess the next element. As its name tells it very well, you just have to say what you see : 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 3 1 2 2 1 1 ... But, what if we had to use a different base to describe it? You could count it in base 3 as this OEIS squence do...
Introduction tl;dr In this challenge you have to calculate the moon's phase for a given date. This challenge is inspired by the game psycho social audiovisual experiment "Superbrothers: Sword & Sworcery EP". In S:S&S EP the moon's phases are important to the outcome of the adventure as some events occur only at a spec...
The PGP Word List is a set of 512 English words for verbally communicating strings of bytes, such as authentication codes or hashes. It is used in secure VoIP software as well as in some other important applications, such as the DNSSEC Root KSK Ceremonies held four times a year. It consists of 256 two-syllable words a...
Generate the sequence number of bases in which n is a palindrome (OEIS A126071). Specifically, the sequence is defined as follows: given a number n, express it in base a for a = 1,2, ..., n, and count how many of those expressions are palindromic. "Palindromic" is understood in terms of reversing the base-a digits of t...
.i xu .e'o lo zunsnagri cu drani loka jboge'a Given an input of a string consisting of two characters, output whether it is a valid consonant cluster in Lojban. Here is a quote from CLL 3.6 detailing the rules for a valid consonant cluster pair (or rather, an invalid one): 1) It is forbidden for both consonants to be ...
Given a side-view of a mini-golf course and the power of the swing, determine if the ball will make it into the hole. A course will be in this format: ____ ____ _ __/ \ / U \ __/ \ / \_ \_/ The ball starts directly before the first piece of ground o...
Introduction The childhood song Eeny, meeny, miny, moe was often used to select who was "it" when playing tag. Everyone would stand in a circle and point at one person selected at random. They would sing: Eeny, meeny, miny, moe, Catch a tiger by the toe. If he hollers, let him go, Eeny, meeny, miny, moe. As t...
Quick musical refresher: The piano keyboard consists of 88 notes. On each octave, there are 12 notes, C, C♯/D♭, D, D♯/E♭, E, F, F♯/G♭, G, G♯/A♭, A, A♯/B♭ and B. Each time you hit a 'C', the pattern repeats an octave higher. A note is uniquely identified by 1) the letter, including any sharps or flats, and 2) the octav...
From a challenge in a programming book long ago, PNZ is a game where the user must guess three unique digits in the correct order. Rules: A random 3 digit number with no repeating digits is generated. (This is what the user is trying to guess) The user inputs a guess of 3 digits, which is to be evaluated by the progra...
Introduction While studying, I tried to come up with several ways to cheat a multiple choice test. It basically is a compressed version of the multiple choice answers. The method goes as following: The answers to the test: BCAABABA These can be converted to 3 different arrays, which indicates true or false if the curr...
Every day, every minute, ... every microsecond, many decisions are made by your computer. In high-level languages, these typically take the form of statements like if, while and for, but at the most basic level there exist machine language instructions called branch/jump instructions. Modern processors queue instructio...
Introduction Suppose you and your friend are playing a game. Your friend thinks of some particular sequence of n bits, and your task is to deduce the sequence by asking them questions. However, the only type of question you're allowed to ask is "How long is the longest common subsequence of your sequence and S", where ...
Introduction There is an Apple tree trunk positioned between -2 to 2 on the x-axis, where some apples fall down around it: | | | | <-------|---|-------> -2 2 Everyday, n apples fall down. Each apple maintains its x coordinate as falls straight to the ground. But if it lands on top of anoth...
Everybody loves geometry. So why don't we try and code golf it? This challenge involves taking in letters and numbers and making shapes depending on it. The Input The input will be in the form of (shapeIdentifier)(size)(inverter). But what are shapeIdentifier, size, and inverter? The shape identifier is the identifie...
URLs are getting too long. So, you must implement an algorithm to shorten a URL. i. The Structure of a URL A URL has 2 main parts: a domain and a path. A domain is the part of the URL before the first slash. You may assume that the URL does not include a protocol. The path is everything else. ii. The Domain The domain ...
If you've read the book Contact by Carl Sagan, this challenge may seem familiar to you. Given an input of a set of mathematical equations consisting of a number, an unknown operator, another number, and a result, deduce which operators represent addition, subtraction, multiplication, or division. Each input equation w...
This is Markov. Markov's golf ball rolls around randomly. Markov's ball will hole however he strikes it. Markov is smart. Be like Markov. And this: is an anthill in Langton's backyard. The anthill is big enough to hold Markov's golfball, MarGolf. However, the anthill moves and changes direction depending on the surro...
Introduction Arrays can also be seen as a field for a bouncing ball. This of course sounds very vague, so here is an example of an input: [1, 2, 3, 4, 5, 6, 7, 8, 9] [9, 8, 7, 6, 5, 4, 3, 2, 1] [1, 2, 3, 4, 5, 6, 7, 8, 9] The challenge is to output the bounced arrays. These are made from diagonal patterns which bounce...
(FB, or Functional-Basic, as found here Interpret Functional-Basic) Task Implement a linting program for FB, similar to JSLint for JavaScript. Error types Invalid identifier Identifiers can only have upper and lower case ASCII letters. Locations: The identifier right after a let expression The identifier in a for loo...
A connected graph is a graph that contains a path between any two vertices. Challenge Build a [2-input NAND-gate] circuit that determines whether a 4-vertex graph is connected. (A gate's 2 inputs can be the same input bit or other gate.) Output True if the graph is connected, and False otherwise. Input The six possib...
Recently, the PPCG design leaderboard has been having some trouble parsing answer html headers. In this challenge you'll be taking your own shot at parsing answer headers. Example Test Cases These example inputs (NOT actual test cases), just so you can get the idea of how inputs might be like Input: <h1>Python 3, 32...
The goal of this challenge is to compute the set of equivalence classes over the transitive closure of a symmetric, reflexive relation. For those who don't know what that means, here is a brief introduction into the relevant terms: A relation ◊ is symmetric if a ◊ b ↔ b ◊ a. It is reflexive if each object is related to...
Introduction Some days ago I needed a metronome for something. I had none available so I downloaded an app from the App Store. The app had a size of 71 MB!!! 71 MB for making tic-toc...?! So code-golf came into my mind and I was wondering if some of you guys could improve this. Challenge Golf some code that outputs s...
A helicopter starting at the top left corner is descending (in a 2D space, for the purpose of this question) towards the ground. It has an autopilot mode and a manual mode. The autopilot mode behaves as follows: If the space directly below is free, descend to it. Otherwise move a step left or right, totally at random....
Note: a 1000 point bounty is still available for this challenge, which I will create and award if anyone takes the top score without using built-in compression. Below is a 386x320 png representation of van Gogh's Starry Night. Your goal is to reproduce this image as closely as possible, in no more than 1024 bytes of c...
Introduction Doppelkopf is a traditional German card game for 4 players. The deck consists of 48 cards (9, 10, Jack, Queen, King, Ace of each suit while every card is in the game twice), so each player gets 12 at the start of a round. There are always 2 teams which are determined by the distribution of the Queens of Cl...
Challenge You will be making a program/function that takes a string input of length n, and: Puts the kth char at the center of the space, where k = (n+1)/2. This will be the location of your ground zero. Puts the rest of the non-whitespace chars randomly arranged around ground zero. The Pythagorean distance from the c...
You live in a rectangular neighborhood which is completely partitioned into N rectangular plots, i.e. there are no gaps or overlaps. Plots do not necessarily have the same width/height as other plots. All widths/heights are positive integers. Your goal is to output all shared edges between plots. Inputs The input may c...
The Möbius function is an important number theoretic function. Your submission should accept a positive integer \$n\$ and return the value of the Möbius function evaluated at \$n\$. Definition The Möbius function \$μ(n)\$ is defined as follows: $$\mu(n) = \begin{cases} \hphantom{-}1, &n\text{ is squarefree and has an e...
Introduction Prime numbers are simple, right? Well, now you get your chance to find out! Challenge You must write a program or function that takes an input n and outputs the first n prime numbers. Example Input and Output Input: 10 Output: 2,3,5,7,11,13,17,19,23,29 Rules You must not include any of the following built...
Given an input of a series of characters representing movements on a hexagonal grid, output the final coordinates of the "pointer." Our hexagons will be numbered like so (imagine a rectangular grid with every odd-numbered column shifted downwards slightly): _____ _____ _____ _____ / \ ...
Introduction Everyone's first program outputs Hello World!. This program should be very simple, that's all you have to do. Challenge Output the string Hello World! to the STDERR. Rules If your language doesn't support STDERR or STDERR doesn't exist for it, you can output it to it's corresponding error system. You can'...
Given a list of the populations of each state, output, from greatest to least, the number of votes that state gets in the electoral college. Input: The first number represents the total number of votes to distribute; it is followed by a list of and populations. In this example, abbreviations for states are used, but an...
The task In this challenge, your input is a non-empty list of positive integers, given in the native format of your language. Your output is that same list, in the same format, with some elements removed. You shall remove every occurrence of 1, every second occurrence of 2, every third occurrence 3, and so on. In gener...
In this challenge, you are passed two words: Your job is to determine if they are adjacent. Two letters are adjacent if: They are the same letter, or They are lexicographically adjacent. For example, J is adjacent to I,J, and K only. Z is not adjacent to A Two words are adjacent if: They are the same length, and Ea...
Introduction tl;dr Continuously output the current distance from the Earth to the Sun. Simplified, the orbit of the Earth around the Sun is an ellipse. So the actual distance between both is constantly changing. This distance can be calculated for any given day using this formula: The equation can be split into the f...
Clock is an interesting card game, as it requires no skill. It is a single player game, and the same card configuration always leads to a win or a loss. In this challenge, you need to figure out whether a given card configuration wins or loses. You can play the game here. The game is played as follows: Thirteen pil...
Final results are here ! Introduction In 2042, the world has become overpopulated. Globalization, overcrowding, new lifestyles and a global lack of hygiene has caused a new pandemic to spread. During those hard times, state leaders have to manage the situation. You can't let your population be decimated, but maybe you ...
In this challenge, you will remove duplicate words from each sentence. Examples Hello Hello, World! Hello, World! Code Code! Golf Code Code! Golf Code Hello hello World Hello World Programming Golf Programming! Programming Golf! Specification Input will be a string of ASCII characters. A sentence is defined a...