Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [string]

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

19
votes
19answers
2k views

Make a Triangularity program valid

Triangularity is a new esolang developed by Mr. Xcoder where code structure has to follow a very specific pattern: For the nth line of code, there must be exactly <...
29
votes
9answers
2k views

Is It Mountainous?

Challenge For this challenge, a mountainous string is one that conforms to the grammar rule M: x(Mx)* where at each production, the all x's are the same character. ...
18
votes
9answers
465 views

Fill in the Bracks

Normal brackets ((),[],<> and {}) are nice and ...
36
votes
19answers
3k views

Bracket Expansion!

Your challenge is to expand some brackets in a program's input as shown: Find a string s between two matching brackets [ and ], ...
33
votes
21answers
3k views

Longest Non-Repeating Substring

Given a string as input find the longest contiguous substring that does not have any character twice or more. If there are multiple such substrings you may output either. You may assume that the ...
-6
votes
5answers
330 views

Write a bullet-proof “Atof” [closed]

Write a bullet-proof "Atof" Atof (Array to float) is a function that every language has to have. (K&R: Atof in chapter 4.2 ...
11
votes
3answers
314 views

Same Name, Lame!

Write a function or program that, when given a list of names, outputs or returns a list where duplicates of given names have a unique shortened version of their surname. Input: A list of names, ...
23
votes
26answers
2k views

Find The Rank Of A Word

Definition The rank of a word is defined as the position of the word when all the possible permutations (or arrangements) of its letters are arranged alphabetically, like in a dictionary, no matter ...
20
votes
1answer
489 views

Reconstruct My Matryoshka Dolls

Background A matryoshka doll (or Russian nesting doll) is a set of dolls that fit inside of each other. I've accidentally mixed up my collection of matryoshka dolls and I don't remember which one ...
17
votes
15answers
4k views

Help my son find his letters

Background Based on a game my four-year-old got from his rabbi. The "goal" is to "find" the letters in a given order, e.g. aecdb. You are given a stack of letter ...
9
votes
5answers
459 views

Case-fold German

Given a German string and an indication of a case (lower/upper/title), fold the string to that case. Specifications Input will consist only of a–...
20
votes
56answers
5k views

Compare two numbers given as strings

I have a problem at work. I need to compare two numbers that come as strings from two different databases. The numbers may come with leading zeroes and/or leading/trailing spaces. So I may have ...
20
votes
5answers
704 views

Convert a HTML page into a mountain

Task: convert a HTML page into a mountain! When HTML pages are indented, they can look like: ...
14
votes
6answers
423 views

String replicator

In Vim, you can repeat a command by preceding it with a number, like 3dd is equivalent to dd dd dd. Well, this repeating pattern ...
22
votes
15answers
1k views

Topple some dominoes!

Thanks to this question for some inspiration In this challenge we will represent a line of dominoes as a string of |, / and <...
6
votes
5answers
216 views

Riffle shuffle a string - Robbers

Cops post A riffle shuffle is a way of shuffling cards where the deck is split into 2 roughly equal sections and the sections are riffled into each other in small groups. This is how to riffle ...
8
votes
9answers
409 views

Riffle shuffle a string - Cops

Robbers post A riffle shuffle is a way of shuffling cards where the deck is split into 2 roughly equal sections and the sections are riffled into each other in small groups. This is how to riffle ...
18
votes
7answers
1k views

Uh, is it a haiku?

So you want to create a haiku, but you're not sure if it follows the syllable rules for a haiku. I couldn't be bothered to write a proper blurb like I usually do, so you'll have to make do with this. ...
22
votes
12answers
967 views

Ternary Triangles

The idea of this is mainly from BIO 2017 q1. I got the idea for posting this challenge from my Binary Sequences challenge, since lots of people seemed to like it. Also, this is the first challenge I'...
7
votes
4answers
200 views

Prefixless Palindromes

Write a program or function that takes N, and S and outputs the number of palindromes of length S you can build using an alphabet of size N such that any prefix of size between 2 and S-1 is not a ...
15
votes
17answers
2k views

XOR sort an array

Given a key, and an array of strings, shuffle the array so that it is sorted when each element is XOR'd with the key. XOR'ing two strings To XOR a string by a key, XOR each of the character values ...
32
votes
39answers
2k views

Flippign Lettesr Aroudn

In chat, we are often fast-typers and don't really look at the order of letters before posting a message. Since we are lazy, we need a program that automatically swaps the last two letters in our ...
15
votes
11answers
2k views

Make me an upside-down Christmas tree!

Challenge We all know about normal Christmas trees - but how about an upside-down Christmas tree! This is a fairly easy, Christmas themed challenge. The objective of this challenge is to make me an ...
30
votes
3answers
465 views

The Drunken Typist

Background A typist comes home wfter some riugh drinkinh and realizes thag an importsnt letter still needs to be wtitten. To make sure he vets the text correct, he writes the text character bh ...
12
votes
2answers
465 views

How long will it take Santa to deliver his presents?

I posted this challenge a while ago, which concerns how many elves Santa needs to deliver presents. Due to population increase, Santa is a little more pressed for time this year. Although in the ...
10
votes
6answers
332 views

Is it a Satisfying Number?

inspired by this chat conversation A satisfying number is a number whose decimal representation is of the form abx, with the following properties: ...
21
votes
27answers
2k views

VEVO User Account Checker

We often see music videos on Youtube. Many Youtube channels that host music videos are "powered by VEVO". Those can be easily identified by both embedding VEVO at their video thumbnails and appending ...
24
votes
61answers
6k views

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 ...
16
votes
9answers
650 views

XKCD Calendar Facts

Inspiration. Posted with permission. Print one of the possible XKCD calendar "facts": You can get the raw text and structure from my APL reference implementation or from Explain XKCD's transcript (...
13
votes
3answers
285 views

Communistic Substring Normalization

If a string T of length K appears K or more times in a string S, then it is potentially communistic. For example, 10 in 10/10 is ...
24
votes
14answers
1k views

Parse the Parcel

Thanks to your help in the Mark My Mail challenge, PPCG-Post has successfully stamped all of its parcels with the generated barcodes! Now, it's time to decode them. In this challenge your program ...
37
votes
69answers
4k views

A very long Terza Rima

Description Output the rhyme scheme for a very long Terza Rima. Input None. Output ...
17
votes
97answers
4k views

Output the language name times the number of characters [closed]

Challenge: Your task is to use any language to output that language's name times the number of character's in its name. Use the common name or acronym of the language. If there are multiple ...
16
votes
15answers
704 views

Parse a list of signed unary numbers

Unary numbers typically only represent nonnegative integers, but we can extend them to represent all integers as follows: A positive integer N is represented as N 1...
2
votes
4answers
126 views

String Permutations - case and order [duplicate]

Challenge For any string that is composed of alphabetical characters of any case, make a function that returns a list of all of it's variations, order and case-wise empty strings returns empty list. ...
13
votes
7answers
441 views

You've got a book to make!

You work at a virtual, old-fashioned printing press. To help you arrange your monospace letters faster, you decide to make the shortest program possible to help you. Given a string of text and a page ...
0
votes
1answer
114 views

Cases variations of a string [duplicate]

For any String that is composed of lower cased alphabetical characters, make a function that returns a list of all of it's variations, empty strings returns empty list Test Cases ...
7
votes
3answers
567 views

The Missing Number - Version 2

Background: This question is a remix of the one that I made previously on this forum. The only difference with this one is: the range is significantly larger, AND dynamic. Details below! Also, I'm ...
17
votes
29answers
1k views

Reverse two sections of a string around a pivot

Background I am currently in an AP Comp Sci A: Java class, and I want to start some of my friends on code golfing. I have a challenge from the course, and I would like to see how many bytes the ...
11
votes
6answers
2k views

Pour me a drink, will you?

The Challenge I am thirsty and need a drink, but I don't know what to order. Your task is to provide me with either a drink or options for one. I/O Input will be either a base or a drink name. If ...
22
votes
3answers
2k views

The Missing Number Revised

Background: I originally posted this question last night, and received backlash on its vagueness. I have since consulted many personnel concerning not only the wording of the problem, but also its ...
39
votes
33answers
3k views

Mark My Mail! - ASCII Barcodes

4-state barcodes Many postal services (Royal Mail UK, Canada Post, US Mail, etc) use a 4-state barcode to encode information about their mail. Rendered in ASCII, it may look something like this: | ...
31
votes
43answers
4k views

The leading zeroes challenge

The challenge Given two integers as input (x and y), output x as a string with as many ...
13
votes
6answers
1k views

Spiral out the Alphabet!

Look at the following string. Notice a pattern? ABEFNOPEFGH DC G Q I M H R J LKJI S K D T L C U M BAZYXWV N E O D P C Q BAZYXWVUTSR As some might have ...
85
votes
9answers
5k views

Golf an Advent Calendar

It's that time of year when many of us get our advent calendars! If you are unfamiliar with an advent calendar, these are special calendars used to count down advent in anticipation of Christmas. In ...
35
votes
52answers
5k views

Random Capitalization

The Task Your task is to create a program or a function that, given an input, outputs the input text with random letters capitalized, while keeping already capitalized letters capitalized. Every ...
21
votes
25answers
3k views

Parse my Esperanto!

The famous constructed language Esperanto uses the Latin alphabet (mostly, see the linked wikipedia page for details). However, there are some characters with accents: ĉ, ĝ, ĥ, ĵ, ŝ, and ŭ. (C-...
14
votes
31answers
1k views

Append and erase

Given one line that consists of only letters, process as following: You maintain a string that's empty at the beginning. If the next input character is in the string, remove it from the string. If ...
27
votes
9answers
2k views

Thanksgiving Feast

Tomorrow, November 23rd, is Thanksgiving Day in the United States. To prepare, you need to cook up some ASCII turkeys. However, since you're late in planning, you need a program (or function) to help ...
25
votes
4answers
3k views

Ain't no thang! …or is it?

Introduction Street talk can be really difficult to understand, in particular to programmers, who aren't known to be very streetwise. It is your job to create an interpreter to help us all survive ...