Linked Questions

60
votes
18answers
4k views

There are two new sheriffs in town – Identifying DJMcMego pairs!

We have some new sheriffs moderators in town, Mego and DJMcMayhem. We need a challenge to properly honour them for their new positions, so there we go. Here's something that has caught my attention ...
29
votes
28answers
3k views

How tall are the monoliths?

Here is an example of an input of monoliths. There are 4 in this example. _ | | _ | | _ | | | | | | | | _ _| |_| |___| |____| |_ The first ...
21
votes
39answers
3k views

X Steps Forward, 1 Step Back

Here the first 100 numbers of an easy sequence: ...
61
votes
15answers
11k views

I HATE spaces in file names

It is simple. I cannot stand when people use spaces when naming files. It sometimes wrecks console commands and makes the output of ls ugly. The challenge is to write a program (only ascii characters)...
25
votes
30answers
4k views

Zero-sum counting

Write a program or function that given n ≥ 1 returns the number of solutions to ±1 ± 2 ± 3 ± ... ± n = 0. For n = 6 there are no solutions, so the answer is 0. For n = 4 there are ...
21
votes
39answers
3k views

Draw a hollow square of # with given width

I got this challenge from Codingame and am curious about better solutions than mine: Given a width via standard input draw a hollow square of '#' in given width and length. Example: 5 results in <...
26
votes
30answers
2k views

Nth Differences

In math, one way to figure out what the type of a given relation (linear, quadratic, etc) is to calculate the differences. To do so you take a list of y values for which the gap between the ...
30
votes
24answers
5k views

The (Easy) Road to Code

Input: An integer \$n\$, which is guaranteed to be \$\ge3\$. An integer \$d\$, which is one of \$[-1,0,1]\$. Output: A road of size \$n\$, which will be in a north-west direction if \$d=-1\$; a ...
39
votes
20answers
3k views

Print the nth prime that contains n

This question will be a twist on finding the nth prime number. Challenge You must write a program that will take one input n, ...
25
votes
29answers
2k views

Replace me by the sum of my cyclic successors!

I have a simple challenge for you this time. Given an array of positive integers A (or the equivalent in your language), replace each entry Ai with the sum of the next Ai elements of A, cycling back ...
26
votes
26answers
4k views

Generate a password

It is very hard to remember my password, so I came up with a way to generate a password. The way I generate my password is from a word or a sentence, following these steps: Start from left to right ...
23
votes
25answers
3k views

The Möbius Function

The Möbius Function The Möbius function is an important number theoretic function. Your submission should accept a positive integer n and return the value of the ...
21
votes
35answers
2k views

Give me Triangles [duplicate]

Given an integer n>0, write a program that will output an "isosceles" Triangle out of #'s of height n. Examples: ...
17
votes
25answers
5k views

The Work Day Countdown

I just had a genius idea for making the work-life easier - a countdown to a specific date which only counts workdays. The basic task is to create a countdown to a specific date which only includes ...
23
votes
29answers
4k views

Find the closest palindromic number

Given a number N, output/return X so that N+X is a palindrome, where |X| has to be as small as possible. Palindrome: A number is a palindrome, if its sequence of digits is the same when reading them ...

15 30 50 per page
1 2
3
4 5
7