Stack Exchange Network

Stack Exchange network consists of 175 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.

11
votes
27answers
2k views

Split into three!

Given a string, you've to split it into groups of three characters (by padding _ at the end). Related, but still it's different. Sample I/O: ...
30
votes
39answers
4k views

pwaS eht tirsf dna tasl setterl fo hace dorw

Or, "Swap the first and last letters of each word" Your challenge is to, given a string of alphabetical ASCII characters as well as one other character to use as a delimiter (to separate each word), ...
10
votes
2answers
275 views

Golf my Ada arrays

Background Ada is a programming language that is not exactly known for its terseness. However, its array literal syntax can in theory allow for fairly terse array specifications. Here is a simple ...
1
vote
1answer
101 views

Building a Structured Outline [closed]

In a fictional document management system, input documents are structured with weighted headings. Lowest weighted headings are the most important. This is a sample document: H1 All About Birds H2 ...
25
votes
41answers
7k views

As programmers say: Strive to be lazy

Story Have you seen this post from 9gag? Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal ...
12
votes
5answers
182 views

Country Code Transformations

Background and Motivation: IOC Country Codes are three letter abbreviations that are commonly used when broadcasting the Olympic Games. The last two letters of some codes overlap with the first two ...
9
votes
10answers
617 views

Determine if a grid contains another grid

Challenge Create a function takes in two 2-dimensional arrays of Characters (or Strings if the programming language does not have characters as a datatype) as inputs: a and b. If your language does ...
8
votes
8answers
543 views

Type-check an expression

Given an infix expression, determine whether all constants are of the same type. Operators will consist only of these dyadic operators: +-/* Your program or ...
4
votes
1answer
214 views

Alphabetical Justice Warrior [closed]

Introduction: Aaron is a young game developer. He recently joined the development team of a game where the players select their character from a predefined set, aka "heroes". Unfortunately, the names ...
13
votes
9answers
350 views

Word Changer Reachability

Word changer is a game where you are trying to turn one word into another via single-character edits, with each step being its own word. For this challenge, edits may be replacements, insertions, or ...
17
votes
6answers
532 views

Generate a Pronounceable Nonsense Word \$n\$ syllables long

Your task is to generate a nonsense word that is reasonably pronounceable with the specified number of 'syllables'. Each time the program is run possibly results in a different nonsense word. ...
39
votes
25answers
3k views

Marquee sign letters

Each day you put up a new word on a marquee sign with movable letters, buying just the letters you need to write it. You re-use letters you've bought for earlier words whenever possible. Given the ...
36
votes
6answers
3k views

List of Python versions

Python is the fastest-growing major programming language today. It is the most wanted language for the third year in a row, meaning that developers who do not yet use it say they want to learn it.[1] ...
31
votes
22answers
2k views

Make it rain characters

Inspired by this chat mini-challenge. Given a string as input (ASCII printable characters only), output the string with the letters "raining" down. Each letter must be a random number of lines ...
19
votes
15answers
2k views

Match Roman Numerals

Challenge Given some input string, return a truthy value if it represents a correct roman numeral between 1 (=I) and 3999 (=...
35
votes
14answers
3k views

Worn-tile Scrabble

Problem You're stuck in a cabin in the middle of the woods, with only an old scrabble set to entertain yourselves. Upon inspection you see that the scrabble letters are so worn, that only the points ...
10
votes
3answers
665 views

How long does it take to type this?

Introduction I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a ...
11
votes
6answers
425 views

String Manipulation Interpreter

Summary A new string manipulation language has been made, using only the characters $+#-!*|@>! Your task is to implement an interpreter for it in as few bytes ...
5
votes
18answers
959 views

To string or not to string

Given an input string, output at random the unique combinations with repetition of the characters in the input string, from length 1 up to the length of the input string, with an equal chance of each ...
15
votes
9answers
619 views

Roll the carpet

This question is inspired by Kevin Cruijssen's question. Now that the carpet is laid out, we want to roll it. Your task is to write a program that takes a string and returns a spiral made from this ...
1
vote
0answers
47 views

Count using letters [duplicate]

What to do? Starting from a, count in the sequence: ...
34
votes
14answers
2k views

Today is the Center

Given a date as input in any convenient format, output a calendar with that date as the exact center of a five-week window. The header of the calendar must include the two-letter abbreviations for the ...
29
votes
26answers
4k views

Arrow those variables!

Challenge Robin likes having his variables declaration in the shape of an arrow. Here's how he does it: Input any number of strings Order them by ascending length Output them ordered by the middle ...
18
votes
20answers
5k views

ssTTsSTtRrriinInnnnNNNIiinngg

Challenge For each character of the string except for the last one, do the following: Output the current character. Followed by randomly outputting from the following list a random number of times ...
9
votes
4answers
439 views

Relevant Part for a Badminton Serve

Introduction: I saw there was only one other badminton related challenge right now. Since I play badminton myself (for the past 13 years now), I figured I'd add some badminton-related challenges. ...
28
votes
19answers
2k views

Rotate a column

Given an integer k and either a block of text, or a 2d array that the inner arrays may have unequal lengths (that resembles a block of text), rotate every character or element in the k-th column up or ...
37
votes
29answers
2k views

Lay out the Carpet

Inspired by this SO question. Challenge: Input: A string \$s\$ A character \$c\$ Output: Create a diamond-square ASCII art of the string in all four directions, with the first character of the ...
10
votes
13answers
353 views

Is there a smaller tautogram checker? [closed]

I got into code-golfing recently and tried to write the smallest tautogram checker. A tautogram is a sentence in which all words start with the same letter, for example: Flowers flourish from France. ...
30
votes
28answers
3k views

Greatest common substring

Create a program or function which takes a list of strings as input, and outputs the longest string that is a substring of all input strings. If there are several substrings of equal length, and no ...
52
votes
23answers
5k views

Make a Bowl of Alphabet Soup

This is what we'll call a bowl of alphabet soup - a roughly circular ascii-art shape with the 26 uppercase English letters (A-Z) arranged clockwise to form the perimeter: ...
4
votes
3answers
299 views

Convert ASCII art numbers to integers

Inspired by this game Challenge: Given an ASCII art string representing a number, output that number. Example: ...
90
votes
32answers
6k views

Would this string work as string?

Write a program that takes a single line string that you can assume will only contain the characters /\_‾. (That's forward and backward slash, underline and ...
10
votes
56answers
2k views

Print last inputted byte

Challenge You have one string of input bytes, output the last byte in it. Rules Your submission may be a program or function outputting the last byte in the input which is either a string, stdin ...
11
votes
31answers
735 views

Sum integers in a string

Input A string. Output The sum of all integers in the line. Constraints 1≤Length of line≤500 Sample test Case Input the 5is 108 seCONd4 a Output ...
6
votes
2answers
342 views

Check if all vowels exist in pairs of strings [closed]

Your program should find the number of string pairs (pairs of 2) that contain all vowels (a e i o u), when given an integer N and ...
6
votes
2answers
285 views

Swapless distances

Suppose you have a string \$s_0\$ and someone else has a hidden string \$s_1\$. You don't know what \$s_1\$ is but they tell you that they can get from your string, \$s_0\$, to their string by making ...
82
votes
67answers
21k views

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Hold up..... this isn't trolling. Background These days on YouTube, comment sections are littered with such patterns: ...
22
votes
18answers
3k views

Play Zip, Zap, Zop

There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the ...
64
votes
55answers
14k views

Sing Baby Shark

"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - ...
13
votes
5answers
569 views

Passwords Strong Against Bishops

Not to be confused with Password Bishop Goodness! Given a string, answer (truthy/falsy or two consistent values) if it constitutes a password which is strong against bishops. A password is strong ...
10
votes
24answers
2k views

Password Bishop Goodness

Derived from this, now deleted, post. Given a string, answer (truthy/falsy or two consistent values) if it constitutes a good Bishop password, which is when all the following conditions are met: it ...
15
votes
7answers
2k views

Borderless table

In this challenge you are going to place letters from the alphabet in a Cartesian plane and output the result as a text. Your input will consist in a list of list with 3 parameters: X coordinate Y ...
6
votes
5answers
291 views

Generate the k-ary necklaces of length n

The set of necklaces is the set of strings, where two strings are considered to be the same necklace if you can rotate one into the other. Your program will take nonnegative integers ...
2
votes
7answers
338 views

Countries by Area

Challenge Given two non negative integers a < b, output all countries, from the below Top 100 Countries, where area is between ...
36
votes
40answers
4k views

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. ...
32
votes
11answers
5k views

Who will win the election?

This is a challenge in which two people, 1 and 2, are running for office. People deterministically vote in certain ways in the world of 1 and 2, which can allow for the candidates to figure out the ...
9
votes
4answers
250 views

Is it Valid Modified UTF-8?

UTF-8 is a relatively simple way to encode Unicode codepoints in a variable-width format such that it doesn't easily confuse code that isn't Unicode aware. UTF-8 overview Bytes in the range of 1-...
7
votes
11answers
421 views

Mis-decode a date

Background Inspired by a now deleted question by John Burger from which I quote: Now obviously no human made this mistake. It's a mis-decode of something - perhaps the ISBN? My question is: ...
5
votes
0answers
130 views

Pattern Finder - Find Repeated Pattern in String [closed]

Introduction This is a little challenge with the goal of identifying repeated pattern "blocks" in a string, and outputting them with their frequency of occurence from left to right. A friend asked ...
17
votes
21answers
916 views

Write a function/method that takes in a string and spells that word out using the NATO Phonetic Alphabet. Titlecase optional

Write a program that takes in a string and spells that word out using the NATO Phonetic Alphabet. The mapping is as follows: ...