Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [string]

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

Filter by
Sorted by
Tagged with
11 votes
17 answers
909 views

A redundant regular expression (regex) is defined here as a regex which has some amount of characters which can be removed while not affecting its functionality -- i.e. it matches the exact same set ...
97.100.97.109's user avatar
8 votes
8 answers
961 views

This is inspired by this homework assignment. Telomeres are regions of repetitive DNA sequences that occur at the ends of linear chromosomes in eukaryotes (such as humans and other mammals). In ...
M--'s user avatar
  • 986
-8 votes
8 answers
307 views

Write the shortest program or function that accepts a sequence of three or more letters and returns its I18n-style numeronym, preserving the original letter case. The I18n-style numeronym is formed by ...
Steve Bennett's user avatar
5 votes
4 answers
351 views

DNA is read in groups of three nucleotides (the letters you see in a sequence), called codons, for determining what protein sequence the portion of DNA will yield. I already used this in a previous ...
Whitehot's user avatar
  • 633
-5 votes
14 answers
443 views

Input: A string, can be multi-line. The newlines must to be real newline (e.g., you cannot request that each newline be (n)). There is another input, a number (not ...
QOO-OOKALAN's user avatar
5 votes
13 answers
854 views

Given a printable ASCII string, return any letter which is not present (ignoring case), if possible, else return the empty string. Test Cases: ...
Steve Bennett's user avatar
5 votes
3 answers
974 views

Your goal is to write a program which will take an input and multiply it by 2. However, there are some catches. You will get an input in one of a few forms: A number (...
Ted's user avatar
  • 2,417
12 votes
2 answers
232 views

You will be given a block of text and a cursor position at the end of a possibly incomplete word. You must output a suggestion for what this word (let's call it w) ...
Ted's user avatar
  • 2,417
12 votes
15 answers
2k views

A loop is a rectangle of text like this: hgf ile jkd abc To unroll it, you start at the bottom left, and proceed to the right, spiralling anti-clockwise in towards ...
Steve Bennett's user avatar
21 votes
10 answers
2k views

Overview I have a sample of 10 quotes. You will receive as input to your program one of these quotes, however all the vowels (aeiou) will be replaced with the ...
Ted's user avatar
  • 2,417
2 votes
4 answers
617 views

Objective Your challenge is to write a program that, given a paragraph from a book, will output another program that prints out that paragraph. (See my example program in an answer) Scoring The link ...
ACertainArchangel's user avatar
5 votes
3 answers
429 views

Overview You will be given a list of strings. If any two elements are equal, you can delete both of them. If one element a is a substring of element ...
Ted's user avatar
  • 2,417
9 votes
11 answers
2k views

My work has recently changed the employee tracking system to one that happens to include a fun game to learn your coworker's faces: Just a small problem: all the pictures include that person's ...
Themoonisacheese's user avatar
16 votes
8 answers
1k views

Given a list of words (letters only) in no particular order, output the shortest string containing every word (disregarding case). Output must be lowercase, except the first letter of each word is ...
Steve Bennett's user avatar
12 votes
3 answers
2k views

Find an NP-complete problem that covers all finite ASCII strings, and present a solver for the problem in the programming language of your choice. By the definition, if there is a finite ASCII string ...
Dannyu NDos's user avatar
  • 7,371
28 votes
27 answers
4k views

NATO Phonetic Spelling is a way to spell out letters so that they're distinguishable over a noisy connection. The mapping of letters (stolen from here) is as follows: ...
emanresu A's user avatar
  • 46.2k
4 votes
4 answers
218 views

Attempt to produce the shortest TeX document that generates the warning Overfull \hbox (<x>pt too wide) in paragraph at lines <y>--<z> that ...
John's user avatar
  • 203
19 votes
12 answers
1k views

Definition A Dyck path of length \$2n\$ can be defined as a two-dimensional path such that: The path consists of straight lines of equal length. The path goes left to right while moving either up or ...
Luis Mendo's user avatar
  • 107k
21 votes
20 answers
3k views

Introduction Esolangs.org user "Tommyaweosme", after getting 3-4 hours into a 17-hour video called "albuquerque but every time a word repeats it loops (normal speed)", created this ...
islptng's user avatar
  • 435
23 votes
10 answers
2k views

Write a function or program which writes an input string out as a snake. The snake starts heading to the right. If a / or \ ...
Steve Bennett's user avatar
12 votes
14 answers
1k views

Objective Given two closed surfaces (a.k.a. closed 2-manifolds), decide whether they're homeomorphic. Introduction In lay terms, a closed surface is a finite-sized shape that resembles a flat plane ...
Dannyu NDos's user avatar
  • 7,371
9 votes
19 answers
1k views

Let's define a centrosymmetric string as follows: First, add spaces to the end of each line to make the input a rectangle \$ A_{m×n} \$, the number of spaces added should be minimized and may be zero....
tsh's user avatar
  • 36.2k
16 votes
12 answers
989 views

Given an alphabet size, \$n>0\$, and an occurrence limit, \$k>0\$, produce the number, \$a(n, k)\$, of strings that may be constructed from the \$n\$ letters in the alphabet which have no more ...
Jonathan Allan's user avatar
13 votes
9 answers
893 views

Every string can be split into substrings that are all palindromes quite easily. For example, "abab" can be split into the palindromes ...
Used_Brain's user avatar
6 votes
5 answers
723 views

Interpret a SqueezeL string SqueezeL is a golfing language I'm developing. Its main distinguishing feature is its 40 character code page, which led me to create a semi-complicated encoding method for ...
AlephSquirrel's user avatar
27 votes
25 answers
1k views

In this challenge you will write a program or function which takes a string and calculates its score. The score is the number of distinct characters, plus each integer \$n\$ such that there is a ...
Wheat Wizard's user avatar
  • 103k
23 votes
16 answers
2k views

Given a string of space delimited words, find the longest word such that, when that word is replaced with spaces, it is still a subsequence of the remaining string. Then, replace everything, except ...
thejonymyster's user avatar
9 votes
18 answers
2k views

In this crossword puzzle by Jack Lance, all the letters have been replaced by a fixed text string: All work and no play makes Jack a dull boy. Therefore, you have ...
3-1-4-One-Five's user avatar
11 votes
6 answers
1k views

Suppose you find yourself in a house of mirrors! You stand in the corner, and you trace how your image reflects off of mirror A, followed by mirror B, followed by mirror C, followed by mirror A. But ...
Peter Kagey's user avatar
  • 8,145
6 votes
16 answers
2k views

Objective Given the name of a robot master in Mega Man: Powered Up except the trailing string Man, output the name of the robot master (again, except the trailing ...
Dannyu NDos's user avatar
  • 7,371
9 votes
17 answers
1k views

Background As the old saying goes, "I before E, except after C". Whilst we already know exactly how true that saying is, I am a stickler for sayings, especially those that rhyme. I want you ...
ATaco's user avatar
  • 11.7k
33 votes
21 answers
3k views

Go Fish! Given a school of fish, for example: ...
Klumpy7's user avatar
  • 453
7 votes
8 answers
997 views

Challenge Solve this problem in the fewest number of bytes of code possible. Write code that takes a string \$str\$ and a dictionary-list of words \$d\$ and finds all combinations of words from \$d\$ ...
Pavel's user avatar
  • 475
21 votes
17 answers
2k views

You work as an architect, and you've been assigned the task of reviewing your coworker's skyscraper design. In your line of work, a skyscraper is just a tower of blocks. Nothing more, nothing less. ...
Trivaxy's user avatar
  • 697
17 votes
10 answers
2k views

Given a string that is a number between 0 and 100 (included) spelled out in French, write a function (or a whole program) that outputs the corresponding integer. List of all test cases : ...
Fhuvi's user avatar
  • 2,251
14 votes
19 answers
2k views

Given a string and a char, add an underscore (_, which won't appear in the input) before any one instance of the char, case-insensitive; if the char never appears ...
l4m2's user avatar
  • 32.4k
6 votes
15 answers
2k views

Today you are having a silly problem. ...
IY5dVSjABEeV's user avatar
  • 1,267
29 votes
38 answers
3k views

Given a string of printable ASCII, count the dots. The following characters have one dot each: i j ...
Jordan's user avatar
  • 11.9k
14 votes
13 answers
1k views

related The golfing languages 05AB1E and Vyxal have a "canvas" builtin that draws a string on a ASCII grid. In this challenge, you'll be implementing a simplified form of this. You should ...
emanresu A's user avatar
  • 46.2k
17 votes
6 answers
2k views

The string abcdefghijklmno, with length 24-1, can be formatted as such: ...
emanresu A's user avatar
  • 46.2k
7 votes
2 answers
355 views

An n-simplex is a generalization of 'triangleness' in any dimension (specifically, it is the simplest shape requiring n dimensions). Starting with 0 dimensions, the named simplexes are: point, line ...
guest4308's user avatar
  • 1,611
-1 votes
1 answer
98 views

Assignment: Create a function that can convert a string to its encoded hexadecimal value. In your answer, also show how to run this function (to validate answers). Your function must return OR print ...
Jake's user avatar
  • 314
7 votes
8 answers
670 views

Objective Given a type signature of a C function pointer represented as a string, output the (fully) curried version of it, also as a string. I/O format It is assumed that: There is at least one ...
Dannyu NDos's user avatar
  • 7,371
14 votes
16 answers
2k views

Objective Given a string consisting of printable ASCII characters (!0x21 ― ~0x7E), treat it as an element in the free idempotent ...
Dannyu NDos's user avatar
  • 7,371
3 votes
1 answer
226 views

Given a list of strings in any convenient format display the amount of comparisons between individual characters that a merge sort algorithm would perform. The merge-sort algorithm is a divide & ...
Kamila Szewczyk's user avatar
24 votes
20 answers
2k views

You are given a string [A-Za-z|]+ that contains exactly one occurrence of | denoting the current position of the cursor and a ...
z..'s user avatar
  • 2,119
9 votes
12 answers
3k views

Keyboard Ping Pong (This question was inspired by this post.) Challenge Given a string of letters, determine if the word "ping-pongs" across the keyboard. (Letters alternating between sides ...
SanguineL's user avatar
  • 738
27 votes
43 answers
3k views

Simple task today. Given a string whose length is one less than a whole power of 2, divide it into segments with doubling length. For example for the string ...
noodle person's user avatar
1 vote
2 answers
277 views

Given an input string, first convert each character to its ASCII value. Generate a reversed Fibonacci sequence of the same length as the input string. Encode each character by adding its ASCII value ...
Dhanush's user avatar
  • 21
0 votes
3 answers
571 views

Given a binary string equivalent to \$n\$, write out the least possible number of terms needed to express \$n\$. A term is defined as an addition of either \$2^k\$ or \$(-2^k)\$, where \$k\$ is a non-...
user avatar

1
2 3 4 5
46