Linked Questions

329 votes
179 answers

Tips for golfing in Python

What general tips do you have for golfing in Python? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Python (e.g. "remove comments" is ...
moinudin's user avatar
  • 12.7k
95 votes
173 answers

Print a Tabula Recta!

The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere cipher and the Trithemius ...
user avatar
167 votes
66 answers

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 an ...
Casey's user avatar
  • 3,609
55 votes
203 answers

Scream very loudly

Write a script that outputs A to stdout infinitely. There should be no newlines or separators between the characters. Standard loopholes apply. This is code-golf. ...
Tornado547's user avatar
  • 1,143
102 votes
47 answers

Implement the Thanos sorting algorithm

The sorting algorithm goes like this: While the list is not sorted, snap half of all items (remove them from the list). Continue until the list is sorted or only one item remains (which is sorted by ...
vrwim's user avatar
  • 2,509
43 votes
50 answers

Find the needle in the haystack

Given a rectangular haystack of size at least 2x2 composed of all the same printable ASCII characters, output the location (counting from the top-left) of the needle which is a different character. ...
AdmBorkBork's user avatar
  • 43.4k
27 votes
66 answers

Find the longest word in an array

Your challenge is to take an array of strings and output the longest string in the array. So for ["tiny", "small", "bigger", "biggest"] the output would be ...
Doggo's user avatar
  • 465
28 votes
63 answers

Write a "Hello" interpreter

Background Hello is a language "written" by Anne Veling, which errors if the program does not contain only h, and will print ...
the-cobalt's user avatar
25 votes
65 answers

Sort odd numbers first

Rearrange a given list such that all the odd numbers appear before all the even numbers. Besides for this requirement, the output list may be in any order. The input will only contain integers, but ...
Developer Marius Žilėnas's user avatar
42 votes
44 answers

Decode the string

This is my first challenge on ppcg! Input A string consisting of two different ascii characters. For example ABAABBAAAAAABBAAABAABBAABA Challenge The task is ...
user avatar
31 votes
47 answers

Subtract the next numbers

Description Subtract the next P numbers from a N number. The next number of N is N + 1. Look at the examples to get what I mean. Examples: ...
Paul Schmitz's user avatar
  • 1,137
40 votes
26 answers

Difference should make no difference

Your company lately hired a new bunch of extremely dedicated sysadmins. They feel that just watching computer screens is quite limiting (I mean, 60Hz refresh rate is just NOT enough), so they hooked ...
Sanchises's user avatar
  • 9,496
30 votes
37 answers

Element-wise string multiplication

Inspired by this challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules. How does it work? ...
ბიმო's user avatar
  • 16.8k
46 votes
19 answers

Can Pac-Man Eat This String?

In the arcade version of the game, Pac-Man eats pac-dots. However, in this challenge, he's hungry for alphanumeric characters and punctuation in a string. Your task is to create a function that feeds ...
atlasologist's user avatar
  • 2,995
20 votes
29 answers

Make every other vowel uppercase

Given a lower case string. Ex: s = 'abcdefghijklmnopqrstuvwxyz' The goal is to make every other vowel uppercase. Desired output here: ...
U13-Forward's user avatar
  • 2,001

15 30 50 per page