instruction
stringlengths
34
53.1k
There have been many other flag challenges posted but not one for the national flag of France. This week seems like an appropriate time. Produce this flag in the fewest bytes possible: The image must be in a ratio of 3:2, with size at least 78 pixels wide and 52 pixels tall. Each stripe takes up one third of the widt...
Write, in as few characters as possible, a program that takes zero or six command-line arguments menorah menorah YEAR MONTH DAY HOUR MINUTE SECOND (Both forms must be supported. The zero-argument version shall be equivalent to calling the six-argument version with the current system date and time in the local timezon...
Bounties No. 1 (awarded) I'll throw in 50 rep for the first valid answer No. 2 (awarded) I'll throw in another 100 rep for the shortest valid answer. No. 3 (open for submissions) I'll throw in 200 rep for the first one with a significant shorter valid answer. Significant being at most 45% of currently shortest a...
Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: 99 bottles of beer on the wall, 99 bottles of beer. Take one down and pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the wall, 98 bottles of beer. Take one down and pass it around, 97 bottles of b...
There are important differences between Python 2 and 3, so it's often useful to know which version of the interpreter is running your code. The straightforward method is something like this: def get_python_version(): import sys return sys.version_info.major But you can exploit other differences to come up with...
Given a string as input, output the US state whose capital it is if it is a state capital, the capital of the state if it is a state, or Arstotzka if it is neither. Examples: Austin -> Texas Alaska -> Juneau The Nineteenth Byte -> Arstotzka All the capitals and their respective states: Baton Rouge, Louisiana Indianapo...
My cell phone carrier charges a cent per character in a text! I need a program to shorten the words for me, while still being understandable. I will be texting this program to my friends, so it needs to be as short as possible. Your program will take a String (a word is separated by a non-alphanumeric character) of wor...
Write a program or function that takes in an odd positive integer N and a string of decimal digits (0123456789). The string represents a ten-state one-dimensional cellular automaton. Each digit occupies one cell and the update rule from one generation to the next is that every cell becomes the digit resulting from the ...
There are n boxes, numbered 1-n. Each box is locked, such that it can be opened by only one corresponding type of key (also numbered 1-n). These keys are randomly scattered in the boxes (one box may have any number of keys, one key may have any number of duplicates), and then all boxes are shut. A treasure (numbered 0)...
Inspired by this question: Make a function (or a full program) that receives a list of numbers and outputs the list rearranged, so that even-indexed numbers appear first, and odd-indexed numbers follow. The values of the numbers themselves don't affect ordering - only their indices do. All indices are zero-based. For e...
New Bonus! (See below) The cartography team of U.S. Republican presidential hopeful Ben Carson is having some trouble with their maps (image via Washington Post): The problem is they don't have the Right Tool For The Job™. They need the most compact and reliable program possible, so they never have to worry about maki...
Boustrophedon is a type of bi-directional text where successive lines alternate between reading left-to-right and right-to-left. Character direction was also mirrored with respect to reading direction. In reverse boustrophedon writing systems, characters were rotated 180 instead of mirrored. Challenge Write a program/f...
Given an image that has only black and white pixels and an (x,y) location that's a white pixel, color the white pixels based on their minimal Manhattan distance from (x,y) in a path that only involves traversing other white pixels. The hue of the colored pixels must be proportional to their distance from (x,y), so the ...
Requirements You need to make a smiley face go from smiling to frowning and back. There needs to the below faces in the code: Smiling, no expression, frowning, no expression, and then back to smiling. The new face needs to replace the old face flipbook style so that there's only one face on the screen at a time. There ...
Statement You are given a still of a series of balls falling in a 2D grid. This grid is surrounded by immutable and unbreakable walls so all the action is contained within them. Your task is to determine what the state of the scenario will be after gravity does all it's work. Elements inside grid - Floor, doesn't alt...
Write a program or function that takes in a string of the characters -=o. where the -=o's and .'s always alternate, character to character. The string will have an odd length greater than one and always start and end in one of -=o. Basically, the input will look like a line of emoticon faces that share eyes in various ...
Introduction BitShift is an esolang, created by me, to output strings. Sounds boring, is boring. However, the only instructions available to BitShift are 0 and 1. Therefore it can be challenging to golf in it. To make matters even more interesting, the language only supports 4 bitshifting instructions, a clear, a print...
Introduction One of the first things I learned in chemistry, was giving the formula for the combustion of alkanes. The most basic example was: 2CH4 + 4O2 -> 4H2O + 2CO2. Note that the equation could have been simplified by dividing every coefficient by 2, we would get CH4 + 2O2 -> 2H2O + CO2. To make things easier, we ...
(massive thanks to El'endia Starman and Sp3000 for helping me design test cases for this!) Given a positive integer n and a list of positive integer rotational periods for a number of clock hands (in seconds), output the smallest positive integer x where x seconds after starting the clock with all of the hands aligned,...
Background The Rearrangement Inequality is an inequality that is based on rearranging numbers. If I have two lists of numbers of the same length, x0, x1, x2...xn-1 and y0, y1, y2...yn-1 of the same length, where I am allowed to rearrange the numbers in the list, a way to maximize the sum x0y0+x1y1+x2y2+...+xn-1yn-1 is ...
A man from the stars has come to Earth! Luckily the president of the United States, Donald Trump, has an infinity-sided die. Using this die, he can conjure up a number which you, the mayor of Podunk, must use to determine who should be sent to stop the invader! But be careful, you can only send a limited amount of byte...
The popular webcomic Homestuck makes use of a programming language called ~ATH to destroy universes. While this code golf challenge is not to write a program to annihilate our existence, we will be destroying some more tame (albeit less interesting) entities: variables.  ~ATH (pronounced "til death," notice how ~ath is...
Take a look at this image. Specifically, at how the holes on the ends are arranged. (Image source) Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a hexagonal lattice is the densest packing of circles. In this challenge, we will be focusing on minimizing the perimeter of a...
This is the cops' thread. For the robbers' thread, go here. Introduction For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs. Cop rules The cops may use up to 256 bytes total t...
This is the robbers' thread. For the cops' thread, go here. Introduction For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs. Robber rules Robbers will try to find the differen...
Given a list of strings, output a single string formed by taking a character from each string at each position, sorting them by ASCII ordinal, and appending them in order to the output string. In other words, for n input strings, the first n characters of the output will be the first characters of each of the inputs so...
King Julian needs to get through the jungle, but he's feeling lazy. He wants a computer to be able to calculate a route through the jungle for him. Using STDIN get a map of the jungle for the computer to crack. It will follow the following format: 01001E 010110 000P00 1100J1 S00111 The way the jungle map works is: 0 i...
In the PPCG chatroom the Nineteenth Byte, using carets ^ (or carrots) is a way of indicating that you agree with one of the previously made comments just above yours. A caret message consists solely of N ^ characters (where N is a positive integer) and it means agreement with the Nth previous message. So a single ^ mea...
Recently, I have found a bijective mapping \$f\$ from positive integers to finite, nested sequences. The purpose of this challenge is to implement it in the language of your choice. The Mapping Consider a number \$n\$ with the factors \$2^{a_1}3^{a_2}5^{a_3}\cdots p^{a_i}\$ where \$a_i > 0\$ $$f(n) = \{f(a_2+1),f(a_3+1...
Your boss has found out that quite a bunch of his employees (including you) like to steal code from others. He ordered you to write him a program that he can use to find people who steal code from others. Task: Write a program/function that detects if somebody copied (part of) his code from somewhere else. The progra...
map is a very basic yet important function in functional programming. All FP programming languages have it built-in but it is always fun to see how shortly you can define it yourself. This will be scored in AST nodes, not bytes. A token is the second-smallest building block of a program, over characters. A token is: a...
Given a string of ASCII characters, output the character that is in the middle. If there is no middle character (when the string has an even length), output the ASCII character whose ordinal is the floored average of the two center characters. If the string is empty, an empty string should be output. Test cases: 12345 ...
Let's say I have a condition expression x and that I want to check if it is TRUE or FALSE depending on the value of a boolean y: y ? x : !x Is there a way to express it without repeating x expression? Something like how we can get a number or its opposite depending on a bool, without repeating the number in the expres...
Background Today (or Yesterday) is (or was) 11/23 or Fibonacci day! What better way to celebrate than to make a Fibonacci cake? Examples 3 ii i_i_ii_i_i </> 8 ii ii ii ii ii ...
Given a character, output (to the screen) the entire qwerty keyboard layout (with spaces and newlines) that follows the character. The examples make it clear. Input 1 f Output 1 g h j k l z x c v b n m Input 2 q Output 2 w e r t y u i o p a s d f g h j k l z x c v b n m Input 3 m Output 3 (Program terminates witho...
What is Toothpick Sequence? According to Wikipedia In geometry, the toothpick sequence is a sequence of 2-dimensional patterns which can be formed by repeatedly adding line segments ("toothpicks") to the previous pattern in the sequence. The first stage of the design is a single "toothpick", or line segment. Each stag...
There's a question on this site that is similar to this question, but I have added a twist. You have three inputs, the number of people in the circle n, the k-th person counted out at each step, and the q-th person that survives. The people in the circle are numbered 1 to n. For example, in a circle of 20 people, the 2...
A typo is said to have occurred if: A character is missing. A character is extra. A character is replaced with another wrong character. For the purpose of this challenge, only lowercase characters and spaces are used. Input will be a dictionary of words, followed by one line of input. You need to find the (minimum) n...
Why a Simulator? Kids these days don't have the time nor the ambition to actually go and stack boxes on the see-saw or play around with balancing physical objects. This leaves lots of room in the software market for a Lever Simulator which will, according to my models, sell like mad! Programming Help Wanted I've filed ...
These days, I watched on TV a Gay Pride parade; at the time, I was thinking about quines and how they're a bit queer, outputting themselves (out of the closet?) and, well, why not combine both things into a Quine Pride Parade? The challenge is to write a program that: Is a quine. Prints the sentence I am a quine writ...
A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that. Your task Write a program/func/etc. that takes two lists: A list of questions and a list of answers. Output a program that quizzes the user. The output program s...
I enjoy participating in math competitions run by Mu Alpha Theta, a mathematics honor society in the United States. At competitions, I take a 30-question multiple choice test. There are five choices per question, labeled A through E. My score on a test is four points for each correct answer, zero points for a question ...
Goal: Your goal is to print out numbers within a given range (Also including given values). Input Format: The input will look like: (int-int, int-int, ...) ... meaning the user can add as many int-int as they'd like. Other Info: You will only have to handle non-negative integer numbers. The first integer in int-int wi...
The goal of this challenge is to find the direction and area enclosed by a loop. Input: A rectangular grid consisting entirely of these characters: ^v<> (Optionally, you may also be given the dimensions of the grid before the grid itself in decimal with a prefix, suffix, and separator character of your choice.) A loop ...
You are given a set of positive integers. You must arrange them into pairs such that: Each pair contains 2 numbers, one of which is a multiple of another. For example, 8 is a multiple of 4, and 9 is a multiple of 9. If the same number occurs many times in the initial set, it can be used that many times in the pairs; a...
Come November 1, Programming Puzzles and Code Golf will graduate, so in the next 11 months, we'll want to save some memories from when we were ungraduated. Write a program that produces the PPCG favicon, seen below. The image must be at least 64x64 pixels. The blue must be the color #62B0DF. The background can be whi...
The goal of this challenge is to produce an animation of a chain drive system, comprised of a set of sprocket gears connected together by a chain. General Requirements Your program will be given a list of sprockets, specified as (x, y, radius) triplets. The resulting chain drive system is comprised of these sprockets, ...
Background Some holidays have fixed, easy-to-remember dates, like Oct 31, Dec 25, etc. Some, however, want to be troublesome. They're specified as things like "the first Monday in September" or "the fourth Thursday in November". How am I supposed to know when that is? All I know is that Thanksgiving is fast approaching...
Introduction You are the manager of the electronics department in a major retail store and the biggest sales day of the year is this Friday. To help manage the crowds, your store is implementing a ticket system for the biggest deals, where customers must present a ticket before purchasing an item. Your job is to write ...
Given a non-negative number n, output the number of ways to express n as the sum of two squares of integers n == a^2 + b^2 (OEIS A004018). Note that a and b can be positive, negative, or zero, and their order matters. Fewest bytes wins. For example, n=25 gives 12 because 25 can be expressed as (5)^2 + (0)^2 (4)^2 + (...
Background You are bored in class, and having exhausted all the possible things to write on a standard calculator (Like 8008135) you turn to the periodic table. You want to figure out if you can write your message using the shorthand for chemical elements. This is the inverse of this challenge. The Challenge Input: A...
Background You are sitting in chemistry class and your friend keep sending you these strange letters. It is your job to decrypt the messages into words. This is the inverse of this challenge. The Challenge Input: A list or a string of integers from 1 to 118. Output: The words for each chemical element if possible. Ot...
dary! In events entirely unrelated to what will hopefully happen to me in the next couple of days, I task you to write code that does the following: Print Legen... wait for it... immediately, with a trailing newline. Wait until the next full hour (when the cron job for awarding the badge runs). Print dary! with an o...
(Hopefully it's still Thanksgiving for you) You got a turkey for your thanksgiving dinner but you don't know how to evenly distribute it. The problem is, some people eat more than others, so you need to find a solution Input There will be two inputs. The first will be an ascii art of various people. o o \|/ \|/ ...
You should write 3 programs and/or functions in one language. All of these programs should solve the same task but they all should give different (but valid) outputs. (I.e. for every pair of programs their should be some input which generates different (but valid) sets of output numbers.) The task You are given an int...
The goal of this challenge is to determine the angle of a line in a image. Rules on the image: The image background will be white (#FFFFFF) The stroke of the line will be black (#000000) The line will NOT be anti-aliased The image will be 100x100 pixels The line will start at the center of the image The line will sta...
Goal Write a full program that generates a map showing the local train stations and which train station is the closest to every point on the map. Requirements Input A set of tuples. The first is the (Width,Height) dimensions of the map. The following tuples are the (X,Y) coordinates of each train station. Coordinate...
One aspect of password strength testing is runs of adjacent letters on the keyboard. In this challenge, a program must be created that returns true if a string contains any runs of adjacent letters. What counts as a run of adjacent letters? For this simplified version of a password strength tester, a run of adjacent ch...
Introduction This is a very simple challenge: simply count the divisors of a number. We've had a similar but more complicated challenge before, but I'm intending this one to be entry-level. The Challenge Create a program or function that, given one strictly positive integer N, outputs or returns how many divisors it ha...
It's friday! Which means it's time for beer! Sadly though, today we will be golfing beer instead of drinking it. :( Challenge Output a beer and drink it. The amount of sips you take changes your output. Sips Your program should take one input string. This string can solely consist out of concatenated sips. If the input...
This challenge is based on a problem described in D. Parnas, On the criteria to be used in decomposing systems into modules, and elaborated upon in J. Morris, Real Programming in Functional Languages. Write a program or function which takes a list of book titles from stdin or as an argument, in a reasonable, convenient...
Challenge Make an error-checker in the least amount of possible bytes! If you received an HTML program as a string through standard input, your program will be able to find all the errors and return to standard output. If the program is over 2000 characters, return that as an error too. Errors As there has been discrep...
Challenge You must output the current time continuously (until cancelled by an interrupt), once every second, by any of the following means: It must be in 24-hour or AM/PM format. If it is the former, it must be spaced out with colons (i.e. 15:47:36). If it is the latter, it must be spaced out with colons and have t...
Introduction The LaTeX typesetting system uses macros for defining accents. For example, the letter ê is produced by \hat{e}. In this challenge, your task is to implement an ASCII version of this functionality. Input Your input is a non-empty string of printable ASCII characters. It will not contain newlines. Output Yo...
A man has two devices. A time machine - He can control this machine by thinking. It allows him to travel from any point in time to another point in time in the past or future (or even the present point in time) in no time at all. Note that if he travels to the past from B to A, then all normal events (time machines, a...
Pretty simple challenge today: Write a program or function that takes in a positive integer N and prints or returns a sorted list of the unique numbers that appear in the multiplication table whose row and column multiplicands both range from 1 to N inclusive. The list may be sorted in ascending order (smallest to larg...
This one is inspired by Calvin's Hobbies recent multiplication table challenge. Write a function or program that takes an integer N as input and prints or returns a N-by-N unique multiplication spiral. The code must (in theory) work for N between 0 and 1000 (outputting this can be hard though). The output should be equ...
Whenever I search for the running length of a movie in IMDb, it is displayed in minutes. Immediately I would try to convert it into hour(s) and minute(s). It would be better if we could automate this. Input: 150 min Output: 2 hours 30 minutes Input: 90 min Output: 1 hour 30 minutes Input: 61 min Output: 1 hour 1 m...
Introduction By steganography we mean hiding a message along an existing text or image so the result would be unsuspicious of the existence of the original message. This challenge is about hiding data in Unicode variants of a grapheme called homoglyphs. For instance: cyrillic Е (ye) appears the same as latin E which ap...
Write a program or function that takes in three positive integers, W, H, and N. Print or return a W×H grid of .'s where every Nth . in normal English reading order is replaced with an X. For example, given W = 7, H = 3, N = 3, the grid is 7 characters wide and 3 high, and every third character reading from the top left...
Today your challenge is to produce all possible full parenthesizations of an expression. Your input is a single line of printable ASCII containing one or more terms separated by operators. The input might also contains spaces - you must ignore these. A term is [a-zA-Z0-9], an operator is [^ ()a-zA-Z0-9]. You may assume...
As part of a city planning project, you've gotten the assignment of creating a program or function that will display the city skyline, given some input from the architects. The project is only in the startup phase, so a very rough sketch is sufficient. The easiest approach is of course to simply draw the skyline in ASC...
Write a program or function that takes in a positive integer N. When N is 1, output /\ \/ When N is 2, output /\/\ \/ / / / \/ When N is 3, output /\/\/\ \/ / / / / / \/ / / / \/ When N is 4, output /\/\/\/\ \/ / / / / / / / \/ / / / / / \/ / / / \/ For larger N the pattern continues, a new layer is added every tim...
In this challenge you will compute numbers from a curious sequence. Your input is a single decimal nonnegative integer. Reverse the bits in this integer and then square the number to get the required output. When reversing the bits you must not use any leading zeroes in the input. For example: 26 (base 10) = 11010 (bas...
Implement a FUSE filesystem in minimum bytes. Your program must do three things: Mounting the virtual filesystem to a directory Handling requests to enumerate files in that directory (showing one file) Handling requests to read the file in that directory Rules: ls (a system program, you don't need to implement it) m...
Romanization of Japanese is converting Japanese text into Latin characters. In this challenge, you will be given a string of Japanese characters as input and expected to convert them to the correct ASCII string. What You'll Need To Know The Japanese language has three writing systems: hiragana (the curvy one used for s...
Count the number of sides on a polygon The polygon-side-counting robot has decided to travel the world without telling anyone before, but it is crucial that the process of polygon counting is not stopped for too long. So you have following task: Given a black and white image of a polygon, your program/functoin should r...
Write a program or function that takes in a string guaranteed to only contain printable ASCII characters except for space, and to be a positive triangular number (1, 3, 6, 10, 15, ...) in length. Print or return the same string, but shaped into a triangle using spaces. Some examples will best show what I mean: If the i...
Given two inputs q n determine if q is a quadratic residue of n. That is, is there an x where x**2 == q (mod n) or is q a square mod n? Input Two integers q and n, where q and n are any integers 0 <= q < n. Output A truthy or a falsey. Optionally, print any (or all) x that is x**2 == q (mod n) Examples >>> quadratic_re...
In a round of the prisoner's dilemma exercise, two players each decide whether to cooperate or defect for that round. The scoring for a round is: Player A and Player B both cooperate: 1 point for both Player A and Player B both defect: 2 points for both Player A cooperates and Player B defects: 3 points for cooperatin...
Relevant links here and here, but here is the short version: You have an input of two integers \$a\$ and \$b\$ between negative infinity and infinity (though if necessary, I can restrict the range, but the function must still accept negative inputs). Definition of the Kronecker symbol You must return the Kronecker symb...
The Bernoulli numbers (specifically, the second Bernoulli numbers) are defined by the following recursive definition: Where denotes a combination. Given a nonnegative integer m as input, output the decimal representation OR a reduced fraction for the mth second Bernoulli number. If you output a decimal representation...
Background This challenge is about the stochastic block model. Basically, you are given an undirected graph, where the nodes represent people, and the edges represent social connections between them. The people are divided into two "communities", and two people are more likely to have a connection if they are in the sa...
A polynomial is divisible by a factor (x-n) if f(n)=0 for a function f. Your job: to determine if a polynomial function f(x) is divisible by (x-n). The input The input is in the form of (x-n), (Polynomial). Remember, if n is negative, (x-n) will be in the input form of (x+n). For the polynomial, all exponents will...
So, like the title says, today you are going to guess my password (sort of). You need to make a big long list of every possible password I might be using on my 4 digit online vault. Specifications: It could contain any 26 letters of the alphabet in UPPER CASE. It could contain any numbers 0-9. So, basically, each di...
The Method of Finite Differences is a technique used to find the next term in a sequence of numbers, given that the sequence is governed by consecutive values of a certain polynomial. Given a list of n terms, the Method will be able to determine the degree of the polynomial, which is a maximum of n+1. The Method works ...
Golf a Purple Interpreter Purple is an esolang which is designed with two main purposes: To be a minimization of Aubergine, since there just aren't enough self-modifying one-instruction languages around. To admit the possibility of terrifyingly small golfed interpreters. My first pass at a reasonably full-featured Pyt...
Can't see emoji? Click here. You will simulate a vending machine. The items are 56 different emojis, which can be represented as two surrogate UTF-8 characters, from: (U+D83C U+DF45) to (U+D83C U+DF7C). In HTML these emojis can be represented in UTF-16 form as &#x1F345 through &#x1F37C. In base 10 the first UTF-8 char...
This king-of-the-hill challenge is based off of the game show, Weakest Link. For those unfamiliar with the show, the crux of this challenge deals with who you vote off: If the other players are smarter than you, then you have less of a chance of getting the pot. If the other players are dumber than you, then you have...
Introduction A normal checkers board contains 8 x 8 = 64 squares: You can see that in total, there are 12 white pieces. Black and white always have the same amount of pieces. If there are any more pieces on the board, the pieces would neighbouring, which is not allowed for this challenge. To clarify things, here are s...
Time for another maze challenge, but not as you know it. The rules for this challenge are a little different than most maze challenges. The tile types are defined as follows: S: The location on the maze you start at E: The location you are trying to get to 0: Wall that you can't cross +: Floor that you can cross You ...
I recently ordered some new and colorful tiles to replace my boring old white tiling for my kitchen. However, when the tiles arrived, they were all in a weird shape! Therefore, I need a program to figure out how to arrange the tiles so that I need to use as few of my old boring white tiling as possible. Even though t...
You are given a nonnegative integer n and an integer p >= 2. You need to add some p-th powers (p=2 means squares, p=3 means cubes) together to get n. This is always for any nonnegative n, but you don't know many p-th powers (of any positive integer) you'll need. This is your task: find the minimum number of p-th powers...
Preamble Integers are always either even or odd. Even integers are divisible by two, odd integers are not. When you add two integers you can infer whether the result will be even or odd based on whether the summands were even or odd: Even + Even = Even Even + Odd = Odd Odd + Even = Odd Odd + Odd = Even Likewise, when...
You will be given a (possibly empty) string containing brackets ([{()}]) and any other characters (A-Z, a-z, 0-9, punctuation). You need to check if it adheres to the following rules: Non-bracket characters are ignored. Every open bracket [{( has a closing bracket )}]. So []( is not allowed. Brackets are nested proper...
I love ><>, ><> is life! 2D langages are amazing! In this challenge, you will have to say if a "fishy" road has an end, while code-golfing. Definition A fishy road is constructed with tiles, including the following ones: v (go down) > (go right) ^ (go up) < (go left) / (mirror) \ (mirror) Any other character (except -...
There's quite a few challenges on this site that ask you to print out a sequence, and this is no exception. (The following explanation of the sequence for this challenge assumes the symbols in the sequence are 0 and 1.) The recursive definition of the Thue-Morse sequence is that T_0 = 0 T_2n = T_n T_2n+1 = 1 - T_n A ...
Background I have constructed a simple obstacle course by placing boxes in a rectangular room. Now I want to count the number of essentially different ways in which it can be solved. I need you to write me a program for that. Input Your input is a non-empty rectangular array of the characters .#. The dots . are empty s...
Write a program or function that takes an array of non-negative integers as input and outputs a set of vectors/arrays with the elements of the input array in order, split so that each vector sums up to 15. If the sum of the first N elements doesn't "hit 15", then the number that made it pass 15 must be cut off, and the...
The formatting order of dates is one of the most complex and divisive issues the world faces today. Some of us vehemently argue that Month/Day/Year is appropriate, considering that's how we say dates out loud. Others loudly proclaim that Day/Month/Year is best, because it puts the terms in ascending order of the durati...