text stringlengths 26 126k |
|---|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
[Question]
[
Inspired by the title of [the *Toggle some bits and get a square* challenge](https://codegolf.stackexchange.com/questions/170281/toggle-some-bits-and-get-a-square).
In that challenge you output how many bits should be toggled, in order for the base-10 representation of the binary to become a square... |
[Question]
[

Imgur is a free image hosting service. Many people use it. Here is an example of an imgur link: <https://i.stack.imgur.com/II8CA.png>. Write a program that continually outputs random (valid) imgur links. For example, here is some sample output of my ... |
[Question]
[
Given as input a positive nonzero integer `n` >= 10 and a sequence of digits `0-9` (which may be taken as a string or a list), find the first contiguous subsequence of digits in the sequence that sums to `n` and output the start and end indexes. You may use zero- or one-based indexing. If no such sub... |
[Question]
[
This was inspired by a function I recently added to my language [Add++](https://github.com/SatansSon/AddPlusPlus). Therefore I will submit an short answer in Add++ but I won't accept it if it wins (it wouldn't be fair)
Don't you hate it when you can multiply numbers but not strings? So you should co... |
[Question]
[]
|
[Question]
[
>
> **Note:** This is a more limited version of a [challenge from 2014](https://codegolf.stackexchange.com/questions/40150/find-a-representative-submatrix) that only received one answer. That challenge required participants write two programs; this challenge is essentially one half of that. The text... |
[Question]
[
Your task is simple, just remove the odd indices and double the even indices
## Example
the input is `Hello, World!` and we get indices
```
H e l l o , _ W o r l d !
1 2 3 4 5 6 7 8 9 10 11 12 13
```
and remove the odd indices
```
el,Wrd
```
Double!
```
eell,,WWrrdd
```
and you are done
1-Indexing... |
[Question]
[
### Your task
Given a string, output the range of ASCII values.
### Example
Let's say we have the string `Hello`.
We get the ASCII values:
* `H` = 72
* `e` = 101
* `l` = 108
* `l` = 108
* `o` = 111
Now, we get the range (`max - min`):
* 111 - 72 = 39
Our answer is 39.
### Test cases
```
Input ... |
[Question]
[
# Challenge
The goal is to output `Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo`.
[Context](https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffalo_buffalo_buffalo_Buffalo_buffalo). (Maybe another interesting challenge could be printing all of the [other examples](https://en.... |
[Question]
[
# Challenge:
Read input (within visible ASCII range) and output with a few modifications:
1. In each set of 10 characters of the input randomly (50/50):
* replace one character\* (with a random\*\* one within visible ASCII range) (ex. `lumberjack` becomes `lumbeZjack`)
* or remove one character (e... |
[Question]
[
### Your task
Given a string of lowercase letters, output the "alphabet checksum" of that string, as a letter.
### Example
Let's say we have the string *"helloworld"*. With `a = 0`, `b = 1`, `c = 2` ... `z = 25`, we can replace all of the letters with numbers:
```
h e l l o w o r l d
7 4 1... |
[Question]
[
# Background
The [Copeland–Erdős constant](https://en.wikipedia.org/wiki/Copeland%E2%80%93Erd%C5%91s_constant) is the concatenation of "0." with the base 10 representations of the prime numbers in order. Its value is
```
0.23571113171923293137414...
```
See also [OEIS A033308](https://oeis.org/A03330... |
[Question]
[
## Introduction
[OEIS sequence A127421](https://oeis.org/A127421 "OEIS sequence A127421") is the sequence of numbers whose decimal expansion is a concatenation of 2 consecutive increasing non-negative numbers. Put simply, every number in the sequence is formed by putting together *n* with *n+1* for s... |
[Question]
[
In this challenge you will take as input a non-empty list of binary values (these can be booleans or integers on the range 0-1), you should output all the ways to partition the list into non-empty sections such that no two adjacent equal values in the initial list are separated into different section... |
[Question]
[
Given a positive integer n, randomly output n non negative integers that sum to one hundred. n will be at most 200. The output should be present as a list of integers (not sorted).
Your random sample should be uniformly sampled from all lists of n non negative integers that sum to one hundred.
Your c... |
[Question]
[
*This is the cops' thread of a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. The robbers' thread can be found [here](https://codegolf.stackexchange.com/questions/251451/polyglot-quiz-robbers-thread)*
In this challenge as a cop you will ch... |
[Question]
[
If the agent is at the origin it always moves right when you choose it.
The goal is to get one agent to 10.
The cost is the sum of the square of the total number of moves (left or right) taken by each individual agent until the first agent gets to 10. You want to minimise the expected cost
Once you h... |
[Question]
[
This is not the same as [m-ss-ng-lette-s](https://codegolf.stackexchange.com/questions/164809/m-ss-ng-lette-s)
**Challenge:**
Given a string with masked characters, generate all possible words, inclusive of non-meaningfull words.
**Rules:**
* The sequence of the characters in the string does not chan... |
[Question]
[
A completely even number is a positive even integer whose divisors (not including 1) are all even.
Some completely even numbers are:
* 2 (divisors: 2, 1)
* 4 (divisors: 4, 2, 1)
* 16 (divisors: 16, 8, 4, 2, 1)
* 128 (divisors: 128, 64, 32, 16, 8, 4, 2, 1).
Some *non*-completely even numbers are:
* 10... |
[Question]
[
Write a program or function that takes in a non-negative integer N from stdin or as a function argument. It must print or return a string of a hollow ASCII-art square whose sides are each made with N copies of the number N.
### Specifically:
If N is `0`, no copies of N are used, so there should be no... |
[Question]
[
They say that `hate` is a strong word. I wanted to find out why, so I had a good look at the word.
I noticed that every consonant had a vowel after it. That made it look quite strong to me, so I decided that that's what makes a word strong.
I want to find more strong words, so I'll need a program for... |
[Question]
[
Given n, k, and p, find the probability that a weighted coin with probability p of heads will flip heads at least k times in a row in n flips, correct to 3 decimal digits after decimal point (changed from 8 because I don't know how to estimate the accuracy of double computation for this (was using ar... |
[Question]
[
[Related](https://codegolf.stackexchange.com/questions/246025/average-ignorant-sets-of-integers).
Given a list of 3 or more positive integers, remove every number X for which there is another number Y in the list and the average of X and Y is also in the list. In other words, if X, Y, and the average... |
[Question]
[
Say I have a ragged list, like:
```
[
[1, 2],
[3,
[4, 5]
]
]
```
And I want to iterate over each item and delete it one-by-one. However, I don't know the structure of the list.
So, I have to iterate over the list, with the following algorithm:
* Look at the first item of the list.
* If it'... |
[Question]
[
A *run ascending list* is a list such that runs of consecutive equal elements are strictly increasing in length. For example `[1,1,2,2,1,1,1]` can be split into three runs `[[1,1],[2,2],[1,1,1]]` with lengths `[2,2,3]`, since two runs are the same length this is **not** a run ascending list. Similarl... |
[Question]
[
## The Task
The task is easy: given an Alpha-2 country code, output the Alpha-3 equivalent. The input may be in any case you choose, and the output in any consistent case of your choosing. Here are the codes:
```
[["AF", "AFG"], ["AX", "ALA"], ["AL", "ALB"], ["DZ", "DZA"], ["AS", "ASM"], ["AD", "AND"... |
[Question]
[
Write the shortest code you can that produces an infinite output.
That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code wins.
Here's a list of answers that I think are really clever, so they can get credit:
* [The comma is... |
[Question]
[
## Problem
John bought 5 apples. You are given the weights of every group of four apples, and must then find the weights of the apples themselves.
For example, if all apples without the first one weigh 798 g, without the second - 794 g, without the third - 813 g, without the fourth - 806 g, and witho... |
[Question]
[]
|
[Question]
[]
|
[Question]
[]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.