text stringlengths 180 608k |
|---|
[Question]
[
English is such an inefficient language. We've got enormous words when
there are plenty of two or three letter words we never used! As
computer scientists, every keystroke matters. We need to be more
efficient. Just think of how many words we could have had! In fact,
don't think about it, tell me.
Gi... |
[Question]
[
Your task is to write a program or function that checks if a string is a valid URL.
Given a string as input, you will output a truthy value if the input is a valid URL. If it is not, output a falsey value. An input string is considered a valid URL if all of the following criteria are met:
* Begins wi... |
[Question]
[
For this challenge you need to make a given word by concatenating "pieces" (a.k.a contiguous substrings) from other words. Given a word and a list of words as input, output the fewest number of pieces needed to create the first word.
# Rules
* Words consist of characters in the ASCII range 33 to 126... |
[Question]
[
For the question [Find the highest unique digit](https://codegolf.stackexchange.com/questions/128784/find-the-highest-unique-digit) , here is [my answer](https://codegolf.stackexchange.com/a/132539/46313) :
```
9A,sqfe=W%X#-
```
At the end I am essentially trying to achieve a lastIndexOf. I do that b... |
[Question]
[
This challenge was inspired by the game Flood.
# Challenge
Given a grid of colors, determine the optimal list of moves to take to convert the whole grid to the same color.
First of all, let us say that a pixel is in the "top left chunk" if and only if it is either the top left pixel or it shares an e... |
[Question]
[
# Introduction
Wardialing was a very interesting way to try to hack people back in the '80s and '90s. When everyone used dial-up, people would dial huge amounts of numbers to search for BBS's, computers, or fax machines. If it was answered by a human or answering machine, it hung up and forgot the nu... |
[Question]
[
After giving back the results of the last topology exam to his students, Pr. Manifold was worried about complaints.
Since he is aware his students know where his office is located, Prof. Manifold decided to transform his office into a bunker with a 10 digit password (all characters are digits).
But ... |
[Question]
[
(*randomly inspired by [this question](https://monero.stackexchange.com/q/2633)*)
Let's make a drawing from some pipes `|` and hyphens `-`. Choosing a subset, if chosen carefully, you can form a rectangular box or block shape (meaning that the corners are formed by `|-` or `-|`). For this challenge, ... |
[Question]
[
I recently found out about the [Fishing](https://esolangs.org/wiki/Fishing) language, and it is now a favorite of mine. However, I'm finding it difficult to do anything cool with it, including code golf. Are there any tips for golfing with Fishing to use the least characters? And any string manipulat... |
[Question]
[
Welcome to BBC Casting. We need a program that we can use to select a new actor to play **The Doctor** on **Doctor Who**. In the spirit of the show, your program will perform a regeneration from one actor's name to the next.
We will test your program by running through the 13 names of actors who have... |
[Question]
[
Disclaimer: This challenge is *extremely* scientifically inaccurate.
;)
Given an input of a list of molecules, output what the result would be if they
were to all combine via dehydration synthesis, if possible.
For the purposes of this challenge, although this description is inaccurate, a
[dehydratio... |
[Question]
[
Isn't it annoying when you're working with floating point numbers and your code doesn't work because two numbers are not equal by the least significant bit? Now you can fix that!
Write some code that takes two floating point numbers in any [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point)... |
[Question]
[
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](http://pastebin.com/wh6yxrqp). There are only 997 words because a few duplicates were removed.
For each word, output a line containing the word, ... |
[Question]
[
In addition to contributing to Stack Overflow and other SE sites, I like to ride public transit during my free time. I'd be spending a fortune on cash fare and/or bus tickets every month if I didn't have a bus pass. But for the average passenger, how much would you need to ride to make it worthwhile ... |
[Question]
[
Write a self replicating program, in the source code filename `H.*`, contianed in an empty folder then manually compile and run or just run the program if your chosen language is dynamic, and it should then just create a new source file, `e.*`, with the same exact source code, and automatically compi... |
[Question]
[
Write a program or function that takes a base `n` and a number `x`, and returns or outputs the [`n`-ary Gray code](https://en.wikipedia.org/wiki/Gray_code#n-ary_Gray_code) of `x`.
## Rules
* `n` is an integer in the range `2 <= n <= 16`.
* `x` is an integer in the range `0 <= n < 2**32`.
* The inputt... |
[Question]
[
*This challenge is specific to languages of the APL family. Although it might be solvable in other languages, please do not expect this to be easy as it depends on some specific concepts of this language family.*
Many array oriented languages have the concept of a box (also called enclosure). A box e... |
[Question]
[
While looking at the ARM instruction set, you notice that the `ADD` instruction has the so-called ["Flexible second operand"](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHEDHIF.html), which can be abused for quick multiplication. For example, the following instruction multi... |
[Question]
[
## *Edit*
I have posted a 250 lines [reference implementation for review at CR](https://codereview.stackexchange.com/questions/83233/correctness-and-understandability-of-my-pcg-reference-implementation), discussing the major class of the code. Download the [complete Visual Studio 2013, .NET 4.5 sourc... |
[Question]
[
# Background
Two strings `s` and `t` are called `k`-Abelian equivalent (shortened to `k`-equivalent in the following) for a positive integer `k` if the following conditions hold:
* The length-`k-1` prefixes of `s` and `t` are equal.
* The length-`k-1` suffixes of `s` and `t` are equal.
* The strings ... |
[Question]
[
A standard road intersection contains 4 sidewalk corners and four crosswalks connecting them. It could also have 2 diagonal walks.
```
sRRRRs
iOOOOi
dAAAAd
eDDDDe
side0----1walk
ROAD|\ /|ROAD
ROAD| \/ |ROAD
ROAD| /\ |ROAD
ROAD|/ \|ROAD
side2----3walk
wRRRRw
aOOOOa
lAAAAl... |
[Question]
[
**This question already has answers here**:
[We're no strangers to code golf, you know the rules, and so do I](/questions/6043/were-no-strangers-to-code-golf-you-know-the-rules-and-so-do-i)
(73 answers)
Closed 9 years ago.
The challenge is programming a program that prints following lyrics of ... |
[Question]
[
There have been a few square root challenges lately, but I think this one is different.
# Challenge
Find an algorithm such that the worst case time complexity is proportional to `n^2` and the best case is proportional to `n` where `n` is the size of the algorithm input. Given a value `x`, find the a... |
[Question]
[
A dog is leashed to a pole and the owner wants to know if it can venture to the neighbour's building. You're given a map, which contains the pole (represented by `x`), the owner's buildings (represented by `1`) and the neighbour's building (represented by `2`). Empty areas are padded with dots and ev... |
[Question]
[
With equations that have more than one unknown, [simultaneous equations](https://en.wikipedia.org/wiki/Simultaneous_equations) can be used in solving for them. This challenge will only deal with [linear equations](https://en.wikipedia.org/wiki/System_of_linear_equations) with two unknowns, to make th... |
[Question]
[
Congratulations, you're now a network administrator! As your first task you will need to configure a firewall to stop any traffic to some blacklisted addresses.
Unfortunately, the only firewall at your disposal only takes in rules in this format:
`x.y.z.t/m ALLOW`
There's no `DENY` keyword. If you wa... |
[Question]
[
This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge: **Given a specific board in the game of Othello (Reversi), find a move for Black that will capture the maximum number of White pieces.**
(Obviously, this may not be the true "optimal" play for Black, but... |
[Question]
[
Inspired by this on Spiked Math:
[](http://spikedmath.com/357.html)
(source: [spikedmath.com](http://spikedmath.com/comics/357-numerical-integration.png))
In this code golf, you are going to write a numerical integrator. Instead of weighting, you first plot ... |
[Question]
[
Given π to an arbitrary number of places, your challenge is to locate indices of π where the index (1,2,3,4...) and the string of numbers from that index carry the same value for the length of the index.
That sounds complex, so let's look at an example!
Indices will count from +1 upwards through natu... |
[Question]
[
**The Challenge**
Given a string containing a random sequence of unique characters A to Z (all upper case, no duplicates), determine the cut-and-paste" sort and output the sort sequence to a specific format (detailed below).
**Definition of Cut-And-Paste Sort, by Example**
Example string:
`AKJCFEGHDB... |
[Question]
[
On TeX.SE the Help Centre says that the following is on topic:
```
Formats like LaTeX, ConTeXt and plain TeX
Engines like pdfTeX, LuaTeX and XeTeX
Distributions like TeX Live, MiKTeX, and MacTeX
Related software and tools, BibTeX, MakeIndex, Lyx, etc.
```
I wanted you to write a program to tell me wh... |
[Question]
[
# Challenge
Your submission should consist of 2 or more programs each written in distinct languages. They can be arbitrarily numbered from 1 to `k`.
Each program `p`, given a natural number `n` should print the *next* `n` prime numbers (initially, the *next* prime is the 0-th prime, 2) on a single l... |
[Question]
[
## Objective
You have two knights on a standard chessboard labelled 1-8 and A-H, one knight is located at 1C and the other at 2G. You have to write a program in the language of your choosing that accepts a set of coordinates from `stdin`, like 2C, and then calculates which of the two knights you have... |
[Question]
[
## Introduction
[](https://i.stack.imgur.com/3NOI8.png)Today is my birthday,
Yes my parents spend a lot time at home during the cold December [**holidays**](https://codegolf.stackexchange.com/questions/57277/its-my-birthday-d) as ma... |
[Question]
[
**This question already has answers here**:
[Topographic Strings](/questions/6600/topographic-strings)
(17 answers)
Closed 8 years ago.
Write a program or function that takes in a string through STDIN or function parameters, tokenizes it by parenthesis, and outputs the tokens on different line... |
[Question]
[
You should write a program or function which given a string as input outputs or returns a string or list of the lowercase letters in the order they find their uppercase pair.
The input is a string consisting of the characters `[a-zA-Z] space` and `newline` representing a torus (rectangular grid with ... |
[Question]
[
I recently moved to an apartment overlooking the inner ring-road of town, and every day, a beautiful scene unfolds. The traffic lights are apparently so confusing (mostly because the Dutch are used to complex intersections, and this one is too simple for them to wrap their heads around), that the int... |
[Question]
[
**your task is...**
Given a string **x** and a positive integer **y**, to determine whether there is a positive integer **b** and an injective mapping from the distinct characters in **x** to the digits of base **b** which permit us to interpret **x** as an integer equal to **y**.
**details:**
I... |
[Question]
[
I just want to do some benchmarking of different programming languages. So here is a tip: You can use as many characters as you want. In the end there is only the time your program needed.
So, here is the Task:
# Task
After searching for a good task that would require a lot of computation, I came up ... |
[Question]
[
The [Routh-Hurwitz](https://en.wikipedia.org/wiki/Routh%E2%80%93Hurwitz_stability_criterion) is a criteria which serves to prove or disprove the stability of an electric control system.
# Idea
Given a system which has an equation of the form `P(s)/Q(s)` where `P(s)` and `Q(s)` are polynomials of any ... |
[Question]
[
This is an interesting one.
I have written a short program in objective-c to encode a string into a brainf\_ck string, this is what it looks like:
```
NSString *input; // set this to your input string
NSMutableString *output = [[NSMutableString alloc] init];
int currentPosition = 0;
for (int i = 0; i... |
[Question]
[
In this challenge you will receive a list of positive integers \$W\$ called a *word*, and a square symmetric matrix \$M\$. Your task is to determine if the word can be turned into the empty list by applying a series of valid moves.
The valid moves are:
1. If two consecutive values in the list are equ... |
[Question]
[
This originally came from [Give the best Chaitin incompleteness bound](https://codegolf.stackexchange.com/questions/266035/give-the-best-chaitin-incompleteness-bound), but I realized that there was a fragment of this problem which still potentially gives a good coding challenge.
## First Order Logic ... |
[Question]
[
This was originally a pure mathematics question, but I think I've got the best chance for an answer here.
## The Challenge
For concreteness, consider Peano Arithmetic (PA). For some language *L* of your choosing, construct a computer program of length at most *N* bits in *L* such that:
1. If it termi... |
[Question]
[
## What is Crazyhouse Chess?
[Crazyhouse Chess](https://en.wikipedia.org/wiki/Crazyhouse) is a chess variant that is basically normal chess except you can place a piece you previously captured back on the board instead of a regular turn.
## Bot interface
Only JavaScript bots are allowed.
A bot is a J... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/226212/edit).
Closed 2 years ago.
[Improve this question](/posts/226212/edi... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic).
Closed 3 years ag... |
[Question]
[
Given required values for an expression with 2 variables, output a short expression which fulfill these values
# Input
You may take the input in any reasonable format, e.g. `f(x,y)=z`, `{(x, y): z}`, `[[[x,y],z]]`, but please write what format is your input is taken in
# Output
Your output needs the ... |
[Question]
[
You're tasked with writing an algorithm to efficiently estimate cost of solving an [Eni-Puzzle](http://www.enipuzzles.com/buy/eni-braille-puzzle-with-bold-colors) from a scrambled state as follows:
You're given m lists of containing n elements each(representing the rows of the puzzle). The elements a... |
[Question]
[
Write the shortest program possible such that when you combine the first character and every Nth character after it into a new program, the output is N. This must work for N = 1, 2, ..., 16.
Another way to say it is, if you *remove* all the characters from your program *except for* the first one and ... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/128651/edit).
Closed 6 years ago.
[Improve this question](/posts/128651/edi... |
[Question]
[
I'll start off by saying I [checked](https://codegolf.meta.stackexchange.com/questions/12392/can-i-ask-about-improving-golfing-on-some-code) and [checked again](https://codegolf.meta.stackexchange.com/a/1724/38550) that this question should be on topic.
I will also clearly state that this is a [tips]... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/119515/edit).
Closed 6 years ago.
[Improve this question](/posts/119515/edi... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/111129/edit).
Closed 6 years ago.
[Improve this question](/posts/111129/edi... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/95254/edit).
Closed 7 years ago.
[Improve this question](/posts/95254/edit)... |
[Question]
[
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... |
[Question]
[
**Input:** Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list.
**Output:** Their sum. Use the same format for output integers as input integers. For example, the inp... |
[Question]
[
### The challenge
The shortest code by character count to help Robot find kitten in the fewest steps possible.
Golfers, this is a time of crisis - Kitten gone missing and it's Robot's job to find it! Robot needs to reach Kitten in the shortest path possible. However, there are a lot of obstacles in R... |
[Question]
[
Write the shortest program in your favourite language to interpret a [brainfuck](http://en.wikipedia.org/wiki/brainfuck) program. The program is read from a file. Input and output are standard input and standard output.
1. Cell size: 8bit unsigned. Overflow is undefined.
2. Array size: 30000 bytes (n... |
[Question]
[
## **Challenge:**
In the last stage of a two players [Texas hold 'em](http://en.wikipedia.org/wiki/Texas_hold_%27em), given a two-card hand and five cards on table, determine your probability to win versus an opponent by the [standard ranking of poker hands](http://en.wikipedia.org/wiki/List_of_poker... |
[Question]
[
The basic parts of [SMTP](http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol) can be implemented in surprising little code. I was able to build an example SMTP client that works with Gmail and Amazon SES [in about 320 characters using PHP](https://gist.github.com/Xeoncross/2002233#file-smtp_m... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/15668/edit).
Closed 8 years ago.
[Improve this question](/posts/15668/edit)... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/5291/edit).
Closed 6 years ago.
[Improve this question](/posts/5291/edit)
... |
[Question]
[
There are 10 types of people in the world, those who understand binary and those who do not.
Where are you? Let's see!
# Challenge
Your task is to convert a decimal integer to binary, only using a set of arithmetic operators (+, -, \*, / and %). You can use conditional statements, loops and variables... |
[Question]
[
Use any programming language to generate two random digits between 1 and 9 (including both). Then your program should display:
* in the first line: the first random digit,
* in the second line: the second random digit,
* in the third line: a number whose tens and units digits are the first and secon... |
[Question]
[
## Powers
We define an `important power` as a number that can be represented as \$ x^y \$ where \$ x ≥ 2 \$ and \$ y ≥ 2 \$.
## Palindrome
We define an `important palindrome` as a number that is the same written forwards and backward, and is greater than `10`. Thus, the last digit must not be `0`.
##... |
[Question]
[
**This question already has answers here**:
[Factorial digit sum](/questions/100823/factorial-digit-sum)
(58 answers)
Closed 5 years ago.
In light of today's date...
A factorial of a number n, is the product of all the numbers from 1 to n inclusive.
## The Challenge
Given an integer n where 0 ... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/24541/edit).
Closed 4 years ago.
[Improve this question](/posts/24541/edit)... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/11940/edit).
Closed 5 years ago.
[Improve this question](/posts/11940/edit)... |
[Question]
[
Given a number determine if it is a circular prime.
A circular prime is a prime where if you rotate the digits you still get prime numbers.
1193 is circular prime because 1931 and 9311 and 3119 are all primes.
```
Input: Output:
1193 circular
11939 circular
1456 ... |
[Question]
[
# Enterprise Quality Code!
### TL;DR
* Answers will consist of a full program (**of length < 30k**) prints the the first N Prime numbers (as a base 10 representation without leading zeros unless the chosen language only supports unary or other based output) separated by newlines (optional trailing li... |
[Question]
[
[Base](https://codegolf.stackexchange.com/questions/224730/base-ically-god): part 1
This is part 2, Strongly suggest you go try out the first one if you haven't tried it.
## Story
As one of the solvers, You've managed to get to the door of the base heaven. In front of the door stands the base guard @... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/3397/edit).
Closed 5 years ago.
[Improve this question](/posts/3397/edit)
... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/20379/edit).
Closed 3 years ago.
[Improve this question](/posts/20379/edit)... |
[Question]
[
In speedcubing, an Ao5 (Average of 5) is computed for a set of five times by removing the fastest and slowest times, and then computing the mean of the remaining three times.
A "rolling ao5" is computed for a sequence of at least five times by computing the ao5 for every set of consecutive five times... |
[Question]
[
### The Challenge
Your challenge is to write a program that evaluates the following function:
f(x, t) = d^x / dt^x (sin t)
That is, the x-th derivative of sin t. In case you aren't familiar with calculus, here is a table of derivatives for the sine function:
...
f(-1, t) = -cos t
f(0, t) = sin t
f(1,... |
[Question]
[
**This question already has answers here**:
[List Prime Numbers [duplicate]](/questions/70001/list-prime-numbers)
(26 answers)
[List of first n prime numbers most efficiently and in shortest code [closed]](/questions/6309/list-of-first-n-prime-numbers-most-efficiently-and-in-shortest-code)
(2... |
[Question]
[
Forgetting quotes can lead to certain problems.
For example, in Scala the two expressions:
```
"("+("+")+(")+(")+")"
("+("+")+(")+(")+")
```
differ only in starting and ending quotes, but they respectively yield the result:
```
(+)+()
+()+()+
```
But this expression in scala almost has the desired p... |
[Question]
[
Your task – if you choose to accept it – is to have your program print, literally, either one of the following:
1. `E=mc²` (if your language supports Unicode (so no HTML trickery, for instance))
2. `E=mc^2` (if your language doesn't support Unicode)
Here are the conditions:
* Your program must consis... |
[Question]
[
(Inspired by the Keg utility of [this](https://codegolf.stackexchange.com/questions/197210/even-and-odd-numbers) challenge)
Given a *non-empty* input string, e.g. `s c 1= e(a"E")`, split the input into even-odd chunks.
## Example (Feel free to suggest more)
I can only think of this test case, fee fre... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/254127/edit).
Closed 1 year ago.
[Improve this question](/posts/254127/edit... |
[Question]
[
In the video game *Minecraft*, the player can obtain experience points (XP) from various activities. In the game, these are provided as XP "orbs" of various sizes, each of which give the player various amounts of XP. The possible orbs are shown in the image below, along with the smallest and largest ... |
[Question]
[
Given a set of vectors all of the same positive finite dimension, output a falsey value if they are linearly dependent and a truthy value if they are linearly independent. A set of vectors v1, v2, ... is linearly dependent if for some scalars a1, a2, ... not all equal to 0, a1v1 + a2v2 + ... = 0. (0 ... |
[Question]
[
Write a program in brainfuck that accepts input of 4 ASCII characters as numbers (from 32 to 126) and outputs the numbers or ASCII equivalent sorted in ascending order.
Requirements: Your program should prompt the user for 4 characters that will be sorted by their ASCII value. All the inputs will be... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/249759/edit).
Closed 1 year ago.
[Improve this question](/posts/249759/edit... |
[Question]
[
**This question already has answers here**:
[Calculate average characters of string](/questions/53675/calculate-average-characters-of-string)
(58 answers)
Closed 8 years ago.
You have been employed by a data analysis company, and have been appointed the task of finding the average character of... |
[Question]
[
Given dimensions of a 2D array, except **1xn**, that results in an odd number of elements, find the midpoint index.
Example: Input is **3x5**, representing the 2D array
>
> [0,0] [0,1] [0,2] [0,3] [0,4]
>
>
> [1,0] [1,1] [1,2] [1,3] [1,4]
>
>
> [2,0] [2,1] [2,2] [2,3] [2,4]
>
>
>
The midpoint... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win.
Closed 8 years ago.
[Improve this que... |
[Question]
[
You are given 4 positive integers: volume of the first container (`v1`), volume of the second container (`v2`), volume of the liquid in the first container (`l1`), and volume of the liquid in the second container (`l2`). Your task is to move some of the liquid from container 1 to container 2, making ... |
[Question]
[
## Introduction:
We all know these three basic arithmetic math tables I assume.
```
ADDITION:
+ | 1 2 3 4 5 6 7 8 9 10
----------------------------------
1 | 2 3 4 5 6 7 8 9 10 11
2 | 3 4 5 6 7 8 9 10 11 12
3 | 4 5 6 7 8 9 10 11 12 13
4 | 5 6 7 8 9 10 11 12 13 ... |
[Question]
[
We seem to quite like digit runs lately, so here's a fairly simple challenge.
Given a positive integer, split it into it's digit runs, and return the product.
For example:
`11122333` would become `111, 22, 333`, the product of which is `813186`
Input may be taken as an integer, string, or list/array ... |
[Question]
[
You are required to find how many triangles are unique out of given triangles. For each triangle you are given three integers a,b,c , the sides of a triangle.
A triangle is said to be unique if there is no other triangle with same set of sides.
Note : It is always possible to form triangle with given... |
[Question]
[
# Task
Your task is to output a single integer, with one restriction: its digits must be a permutation of [1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6].
For example, you could output 653443653152432, 413265345463352, or any of the other 15-digit integers whose digits are a permutation of the list.
# ... |
[Question]
[
The **[Pythagorean Theorem](http://en.wikipedia.org/wiki/Pythagorean_theorem)** states that for a right triangle with sides `a`, `b`, and `c`, a2+b2=c2.
A [**Pythagorean triplet**](http://en.wikipedia.org/wiki/Pythagorean_theorem#Pythagorean_triples) is a set of three numbers, where a2+b2=c2, a
To ex... |
[Question]
[
## Description
In this challenge, you need to write a function that takes in a list of strings and returns the smallest string based on their ASCII value. You should assume that the input list contains only lowercase alphabetical strings.
## Test Cases
```
["a", "b", "c"] => "a"
["hello", "world", "c... |
[Question]
[
Strangely never asked before, this question pertains to the generation of a list of prime numbers within a given range using the shortest possible code. Several algorithms, such as the Sieve of Eratosthenes and trial division, are known to be effective for this purpose, but require significant code l... |
[Question]
[
Your task is to make a program in `L` that takes `n` as an input number, output a program `p` in `L` that prints its own first `n` characters.
## Rules
* The program `p` has to be irreducible, See an example below.
* **PAY ATTENTION TO THIS RULE:** If a program takes an input as `n`, the first `n` ch... |
[Question]
[
Given an input string, output at random the unique combinations with repetition of the characters in the input string, from length 1 up to the length of the input string, with an equal chance of each one occurring.
Example: given the input `abcd` (or any combination thereof of the four characters `a`... |
[Question]
[
In this challenge, you must write a Hello World program that is *both short and complex*. We measure complexity by [Cyclomatic McCabe complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity), and length by the number of bytes (not characters).
Score = complexity / bytes
For example, if the cy... |
[Question]
[
Constraints:
1. Calculate any notable irrational number such as pi, e, or sqrt(2) to as many decimal digits as possible. If using a number not mentioned in the list above, you must cite how and where this number is used.
2. The memory used to store data in variables that the program reads from at any... |
Subsets and Splits
Python Q&A Count
Counts the number of questions and answers related to Python in the dataset, providing insight into the prevalence of Python content.