Linked Questions

43 votes
57 answers
8k views

Catalan Numbers

The Catalan numbers (OEIS) are a sequence of natural numbers often appearing in combinatorics. The nth Catalan number is the number of Dyck words (balanced strings of parenthesis or brackets such as <...
a spaghetto's user avatar
  • 11.2k
63 votes
30 answers
20k views

Tips for golfing in C++

What general tips do you have for golfing in C++? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C++ (e.g. "remove comments" is not ...
moinudin's user avatar
  • 12.7k
29 votes
82 answers
5k views

Determine if Strings are equal [closed]

Your task is simple. Determine if one string equals the other (not address, the value) without the use of equality operators (such as ==, ...
Dave Chen's user avatar
  • 423
52 votes
43 answers
15k views

The Snail in the Well

Background There's a common riddle that goes something like this: A snail is at the bottom of a 30 foot well. Every day the snail is able to climb up 3 feet. At night when they sleep, they slide ...
musicman523's user avatar
  • 4,772
43 votes
41 answers
7k views

Ot wes thi bist uf tomis

I just love this simple cypher, it's so fun reading not-quite human-readable words and filling the gaps... ...
AJFaraday's user avatar
  • 11.8k
38 votes
33 answers
7k views

Draw the flag of Bangladesh

The flag of Bangladesh is very simple. It looks like below: The flag will be in bottle green (#006a4e) and rectangular in size in the proportion of length to width of 10:6, with a red circle in near ...
Wasif's user avatar
  • 12.3k
44 votes
47 answers
4k views

Is it a balanced number?

A number is balanced if the sum of the digits on each half of the number is equal, so: 1423 is balanced because 1+4 = 2+3, so is:...
Stewie Griffin's user avatar
27 votes
55 answers
4k views

Convert C header names to C++ header names

In the C standard library, header names end with a .h suffix: stdio.h In C++, those header names are available in an ...
fredoverflow's user avatar
  • 2,709
27 votes
55 answers
4k views

Approximation of e

We all know that the Euler's number, denoted by \$e\$, to the power of some variable \$x\$, can be approximated by using the Maclaurin Series expansion: $$e^x=\sum_{k=0}^{\infty}{\frac{x^k}{k!}}=1+x+\...
Meow Mix's user avatar
  • 913
20 votes
83 answers
3k views

Calculator that adds char values

Task Build a calculator, that takes any string, from a file, stdin or whatever, and adds up all the values of the chars. Example Input Hello World! Output 1085 ...
Knerd's user avatar
  • 1,361
40 votes
38 answers
3k views

Output a Magical 8 Trapezium

Your task is to output a Magical 8 Trapezium: ...
rybo111's user avatar
  • 4,557
104 votes
14 answers
5k views

Seven Slash Display

Write a program that takes in a non-empty string of the digits 0 through 9 and prints how they would be shown on a seven-segment display using slashes (/, ...
Calvin's Hobbies's user avatar
31 votes
35 answers
5k views

Help, I've mixed my week up!

My dog ate my calendar, and now my days are all mixed up. I tried putting it back together, but I keep mixing up the days of the week! I need some help putting my calendar back together, with the days ...
maxb's user avatar
  • 6,887
26 votes
45 answers
2k views

Does the nth char equal the nth from last char?

Inspired by Does the start equal the end Given a string s and an integer n, output a truthy/falsey as to whether the ...
Stephen's user avatar
  • 13.8k
19 votes
56 answers
3k views

Find the number of integers in the range from 1 to N that ends with 2

Task As input you have: a positive integer N And you should output: The number of integers in \$[1,N]\$ (an inclusive range) which end with the digit \$2\$ in ...
USERNAME GOES HERE's user avatar

15 30 50 per page
1 2
3
4 5
8