# Tagged Questions

A competition to solve a particular problem through the usage and manipulation of strings.

241 views

### Semi-decide Post's Correspondence Problem

The Post's Correspondence Problem (PCP) gives you a list of pairs of strings, P_1 ... P_n. Your task is to find a k, and some sequence of k indices such that fst(P_i1) ... fst(P_ik) = snd(P_i1) ... ...
5k views

### Count of “a”s and “b”s must be equal. Did you get it computer?

In the popular (and essential) computer science book, An Introduction to Formal Languages and Automata by Peter Linz, the following formal language is frequently stated: mainly because this ...
1k views

### What exactly was your question?

Introduction When you are given a boring text, you just want to get it over with as quick as possible. Let's observe the following text: Ens colligi timenda etc priorem judicem. De quascunque ii at ...
4k views

### Polar Bear, Polar Bear, what do you hear?

The text of the children's book Polar Bear, Polar Bear, What Do You Hear? has a very simple pattern. You might use the text to teach introductory programming concepts. My son was quickly bored by ...
2k views

### Which ghosts are missing?

In this challenge, given a list of ghosts from Pac-Man, you must output which ghosts are missing. You must do it in as few bytes as you can Input Input will consist of a string or list, which will ...
779 views

### Select the word around the given index in a given string

In Windows, when you perform double-click in a text, the word around your cursor in the text will be selected. (This feature has more complicated properties, but they will not be required to be ...
3k views

### #Hashtag_or_not

In this code golf, You will verify Hashtags! #What_your_code_should_do Input a string. output truthy value if it is a valid hashtag, and falsy value if not. We define a string as a valid Hashtag if....
809 views

### Find numbers within the Copeland–Erdős constant

Background The Copeland–Erdős 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. ...
309 views

### Write a program to display directory treehouse

Given a directory (such as C:/), given from stdin or read from a file, produce a directory tree, with each file/folder indented based on its depth. Example If I have a C:/ drive which only contains ...
1k views

### Remove duplicated & switched case

Goal The goal of this challenge is: given a string as input, remove duplicate pairs of letters, if the second item in the pair is of opposite capitalization. (i.e. uppercase becomes lowercase and ...
838 views

### I programming puzzles, il code golf

Background The Italian definite article (corresponding to English the) has seven different forms: l', il, lo, gli, i, la, le. Which one to use depends on three variables: Gender: masculine / ...
446 views

### Directory calculation

For this challenge, you will be given an absolute path, and a "new" path (which can be absolute or relative), and you need to return the final path. For example, if your current directory was /var/...
1k views

### Post-determined Array Sorting

Input: An array containing three integers: 0, 1 and 2 in any order (i.e. [2, 0, 1]) And a string of length >= 2 only containing alphabetic letters (both lower- and uppercase) and digits (i.e. a1B2c3)...
365 views

### Find the paths!

You must write a program or function. The input is a 'map' of numbers. You can choose to take the map as either a string with new line characters (\n) or a 2D array of strings. All maps are 5 ...
1k views

### Convert n strings of m length to m strings of n length

Write a program that, given any 'n' number of strings of 'm' length, returns 'm' number of 'n'-length strings, with this condition: Every new string should contains the letters at the same index of ...
2k views

### Unzip some numbers

Your task is to create a program or function that generates a zipper with a length of 10 lines. Each line of the zipper is represented by two dashes --: -- -- -- -- -- -- -- -- -- -- The program/...
339 views

### Do not repeat yourself

Inspired by this challenge Given a number m, output a program that prints out the string Do not repeat yourself. Now for the challenging part: Each program the original code prints out has to have ...
210 views

### Golf a Sentence

Everybody loves golfing code. Code is written in English (eh...). Therefore, everybody loves golfing English! Your task is to write a program or function that takes a string as input, and then ...
129 views

### Directory Structure Graphical Treefication

Convert a classical directory structure like this: config.yml drafts begin-with-the-crazy-ideas.textile on-simplicity-in-technology.markdown includes footer.html header.html Into ...
2k views

### Duplicate & switch case

The goal is, having taken a string as input, duplicate each latin letter and "toggle" its case (i.e. uppercase becomes lowercase and vice-versa). Example inputs & outputs: Input Output bad ...
383 views

### Truncate consecutive character runs to n length

The challenge Given an input string, and an integer n - truncate any runs of consecutive characters to a maximum of n length. The characters can be anything, including special characters. The ...
237 views

### Normal sentences

Write a program or function which, given an input string and a standard deviation σ, outputs that string along the normal distribution curve with mean 0 and standard deviation σ. Normal distribution ...
2k views

### Generate a Stack Exchange Favicon

Do you recognize the PPCG logo? it looks like this, when you do an ascii art of it. +---+ |PCG| +---+ v Now, In this Code Golf, You will make a code, that makes logos for other sites, similar to ...
3k views

### Determine the “Luck” of a string

Given a string, return that string's "luck". A string's luck, as I completely just made up for the purpose of this challenge, is an integer, determined as so: The base luck for a string is 1. For ...
3k views

### Reverse a string while maintaining the capitalization in the same places

The goal here is to simply reverse a string, with one twist: Keep the capitalization in the same places. Example Input 1: Hello, Midnightas Example Output 1: SathginDim ,olleh Example Input 2: .Q ...
4k views

406 views

### Domain Name Appraisal

Domain name trading is big business. One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth. ...
316 views

### Compute the runs of a string

Consider the following definitions taken from The number of runs in a string by W. Rytter. Note that word, string and substring are all roughly synonyms. A run in a string is a nonextendable (...
3k views

### Where should I put my mirror?

This is a mirror: |. I just found out that you can stick a mirror in the middle of a string if the string can be mirrored on itself! For example, the string abccba. If you cut it in half the two ...
258 views

### Parse and Process the Key-Language Input

Let's parse and process Key-Language! Given the input of a sequence of keyboard keypresses and/or special keys, write a program, function, etc. that outputs the product when all the actions are ...
1k views

### What's the second non-repeating character?

Based on this question from Code Review Given a non-empty string of printable ASCII characters, output the second non-repeating character. For example, for input DEFD, output F. Input A single ...
9k views

### 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 ...
197 views

### Write a AZERTY to QWERTY converter [duplicate]

Your task is to create a program will transform each letter of a text typed on a AZERTY keyboard to the equivalent on a QWERTY keyboard, using the same keystrokes. Example: Hello; Zorld1 => Hello, ...
2k views

### Professor Schwartzman's Acme Canine Decoder 2000

Introduction We -- especially the geeks among us, who tend to be fans -- all remember this old Far Side cartoon: Clearly, Professor Schwartzman could have brushed up on his programming skills just ...
2k views

### I only pay with dollars

As the title -- although discretely -- hints, I only pay with dollars. The challenge Write a function/program that takes a string as input, which is a monetary value preceded by a symbol. ex) £4.99....
730 views

### Character Counting System [duplicate]

GOAL : To Implement a character counting program This is how this counting system works : input of the program is a set of printable ASCII characters . the program counts each type of character , ...
4k views

### Write a program to elasticize strings

Nice verb there, in the title. Write a program that given an input string, will "elasticize" this string and output the result. Elasticizing a string is done as follows: The first character is shown ...
227 views

### Convert the first letter of each word to uppercase, and the rest to lowercase [closed]

Description Your task is to take a string as input, and convert the first letter of each word to uppercase, and the rest to lowercase. Test Cases Input => Output ISN'T THIS A REALLY COOL TEST CASE?...
2k views

### Reverse the consonants

The program should take a string as input and reverse the consonants in it, while keeping the order of vowels. All the letters will be lowercase, so you don't have to worry about casing. Examples ...
4k views

### Lithp Tranthlator

My friend made a lisp translator the other day, that is to say it took a string and converted s=>th and S=>Th. It was quite long and I thought that it could be golfed. So the task is to make a ...
539 views

### The teacher is always wrong, flip his answer

Your dumb teacher is always wrong, so flip his answer. Change these responses True -> False Yes -> No 0 -> 1 Yeah -> Nope and vice versa. Keeping punctuation and the first letter's ...
2k views

### Write a program that reverses the name of its source file

In a single file, write a program that requires no input and produces no output. When run it should reverse the name of the file it is contained in, regardless of what the name is, without altering ...
60 views

I recently stumbled on the fractal word abacabadabacaba..., which is a 67 million letter word according to a pattern. The full word is actually the 26th word in a series as follows: A aBa abaCaba ...
2k views

### Geobitsian Language

Geobitsian language is a new perversion of English where a word is broken into segments that each must start with a different letter. Then every time one of those starting letters appears in another ...
342 views

### Determine the winner of a game of War

The card game War is interesting in that the final outcome is entirely determined by the initial arrangement of the deck, so long as certain rules are followed for the order in which cards are picked ...
706 views

### Oneliner to merge lines with same first field

This is my first codegolf question, so I apologize in advance if it's not appropriate, and I welcome any feedback. I have a file with this format: a | rest of first line b | rest of second line b | ...
931 views

### Case Permutation

Who needs to compare things case insensitively when you're able to generate every permutation of uppercase and lowercase? No one! That's the answer. No one does. Your task is to achieve this feat; ...
3k views

### 24 and 12 Hour Times

Write a program or function with no input that prints or returns this string of 24-hour and 12-hour times: 00:00 12:00am 01:00 1:00am 02:00 2:00am 03:00 3:00am 04:00 4:00am 05:00 5:00am 06:00 6:...