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.

2
votes
8answers
278 views

Decode My String (Brackets) [duplicate]

Taken from StackOverflow Question Challenge Given an encoded string in format n[s] where n is the amount of times ...
7
votes
4answers
848 views

Insulate the Window Glass and Foil of your house

Introduction: The best options for the glass of your house will: 1. Let through as little heat as possible in both directions (insulation-value Ug). (2. Let ...
1
vote
5answers
312 views

String Array to JSON String

Introduction I've seen throughout the code-golf challenges several simple tasks involving JSON, such as interpreting JSON strings with RegExs, and almost every other manipulation I could think of. ...
15
votes
14answers
1k views

A Capital Cipher

Your task is to decipher a non-empty string consisting of printable ASCII characters in the range [32..126]. Reading the string character per character: each time you encounter a letter in lowercase,...
14
votes
10answers
1k views

Decoding the Kaadi system

You have come across an old Indian manuscript, one that describes mounds of buried treasure. The manuscript also tells you the location of the treasure, except that some crucial numbers have been ...
7
votes
8answers
876 views

Divide two strings

One day, I saw the challenge to multiply two strings and I thought I might be able to do one better. That challenge was fake. It was elementwise maximum. It was not real multiplication. So I set out ...
-1
votes
2answers
195 views

Equal Pair sum of 10? [duplicate]

Challenge : Check : if there are exactly n exclamation marks ! between every pair and ...
25
votes
25answers
3k views

Golf A Parentheses Matching Algorithm

You will be given a string s. It is guaranteed that the string has equal and at least one [s and ...
-5
votes
9answers
201 views

Math Operations with Strings [duplicate]

Challenge : Inspired by Alphabet Position Finder Given an string and one of two possible mathematical operator (+ or -) as ...
-5
votes
1answer
153 views

split a string with two types of groups, ignoring characters in one [closed]

Example inputs and outputs: Input 1 "request.partner" Output 1 [request, partner] Input 2 ...
15
votes
4answers
511 views

Generate a Portmantout!

Background Three years ago, this guy Tom Murphy got it into his head to extend the idea of a portmanteau to all words in a language and called this a portmantout (portmanteau plus tout [French for ...
24
votes
19answers
3k views

Rememebere tehe vowelese!

Input A string of printable ASCII characters, for example: This is an example string. Output For every consonant (...
23
votes
10answers
986 views

Shortest Uniquely Identifying Substrings

Given a list of strings, replace each string by one of its non-empty substrings which is not a substring of any of the other strings in the list and as short as possible. Example Given the list <...
34
votes
26answers
4k views

Exchange capitalization

Given two strings of letters, transfer the capitalization pattern of each string onto the other one. Fewest bytes wins. ...
2
votes
1answer
107 views

Array-of-array string conversion to and from matrix [closed]

Matrix challenges are popular. There's an issue of how to provide test cases. A common method is the row-wise array-of-arrays representation, such as: ...
10
votes
38answers
2k views

Alphabet Position Finder

Inspired by the Codewars Kata. Your goal is to take an input string such as this one: "'Twas a dark and stormy night..." and return a string containing the ...
23
votes
19answers
6k views

New Password Idea: Word-walker

I thought of a new way to generate my passwords, and even though it's probably not very clever in the long run, it could still make for a fun code-golf. Taking a string of words, the password is ...
13
votes
6answers
2k views

Use that goodn't meme

There is currently a meme on the internet that consist of taking a sentence, reverse the meaning and adding n't at the end. For example, ...
-9
votes
18answers
269 views

How long is this string?

It's strange this question hasn't been asked yet, so here it is: Calculate the length of a string given through STDIN Rules As said, your string will be given through STDIN, not via command line ...
21
votes
25answers
2k views

Sort a string by a given ordering

Your challenge is to sort a string, but rather than by the normal alphabetical order (abc..xyz), you will be sorting strings by a specified alphabet. You must write a program or function that takes ...
10
votes
1answer
278 views

Self-enumerating pangrams

Pangrams The quick brown fox jumped over the lazy dog. This is an example of a pangram - a sentence that contains every letter of the alphabet at least once. A self-enumerating pangram is a ...
29
votes
15answers
3k views

Fridge magnet substitution

When writing a message with fridge magnets, you'll often find yourself substituting a 1 for an I. In this challenge, your goal ...
5
votes
5answers
364 views

M_ss_ng Lette_s

Given this list of all the words in english and a string with s_me missi_g lett__s, find one way to fill in the letters. Do note that some words on the list contain special characters (...
42
votes
25answers
5k views

prOGraMMIng PuZZleS & cOde ____

Input A non-empty encoded string consisting of printable ASCII characters (in the range 32-126), where some missing letters have been replaced with _. Output A ...
14
votes
24answers
1k views

split and capitalize

Challenge : Given a string split at specific positions and capitalize the first character of the given word. Capitalize the first word's first char if and only if it was already capitalized Input : ...
22
votes
9answers
3k views

Take CR and LF literally

As a celebration of good old Notepad, we are going to treat carriage returns and line feeds as what they originally meant, rather than what they are (ab-)used for today. Given a string consisting of ...
16
votes
10answers
2k views

Assign Airliner Seats

Inspired by last week's APL lesson. Given an uppercase 2D seat map and a 1D list of customers, return the seat map and the customer list but modified as follows (to indicate occupied seats and seated ...
11
votes
3answers
345 views

Word Search on a Torus [duplicate]

The Challenge Given a list of words and a grid of letters, your job is to determine which of the given words can be found on the grid in all 8 directions (forward, backward, up, down, and the 4 ...
41
votes
32answers
2k views

Enklactify these strings

Inspired by this comment chain... I wanna enklact my way out of this challenge but I can't... @ETHproductions to enklact (v): to implement a lookup table ...
20
votes
11answers
3k views

Can You Spell This Word With These Dice?

Letter dice are common in word games. It can be fun to try to spell funny words with boggle dice, for instance. If you grab a handful of dice, chances are you won't be able to spell certain words. ...
14
votes
23answers
2k views

Elixir Array Syntactic Sugar

In Elixir, (linked) lists are in the format [head | tail] where head can be anything and tail is a list of the rest of the list, and ...
1
vote
0answers
104 views

Vowel position changer [duplicate]

Challenge : Sort the vowels (only vowels) in the given string . Note : Vowels are the following characters: A, E, I, O, U Vowel sorting is cyclic i.e. After rearrangement the first vowel of sorted ...
24
votes
33answers
4k views

You must construct ASCII Pylons!

Cross posted from my anagolf post (note: may contain spoilers, post mortem). Output the following text exactly. You may have additional trailing whitespace on each line, and trailing newlines as ...
-4
votes
2answers
260 views

??? Question Marks? [closed]

Challenge Create a function that takes an string as a parameter. (Easy as far) This string will contain Single digit numbers Letters from the alphabet Question marks (Of course) Your function will ...
5
votes
12answers
416 views

Help me redirecting

Your task is to automatically complete URLs like the address bar in most browsers is doing. We will use the following (simplified) rules: If the input string starts with ...
16
votes
9answers
556 views

Intermediate String Array Reflection

Let's start by re-defining a reflection of a character in a 2-d array of characters: Given a square 2-d array of characters with distinct lowercase alphabetical letters, define a reflection of a ...
41
votes
43answers
4k views

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 ...
13
votes
3answers
344 views

Word Search Solver

I got to wondering yesterday if I could write a program to comb through a given word search and output the answers. It was actually surprisingly easy. Now I wonder just how small we can get. Rules ...
26
votes
19answers
2k views

Simple String Reflection

Let's start by defining a reflection of a character in a string: Given a string with distinct lowercase alphabetical letters with no spaces such as abcdefg, ...
-9
votes
3answers
194 views

string char rotation [closed]

Challenge : Given a string rotate every char by its index. e.g --> 'Hello' should be 'Hfnos'. Input : Input is given as string ...
5
votes
3answers
144 views

Overlapping Strings [closed]

Challenge A simple challenge: given two or more strings, output all of the substrings that are in each string. Rules Input is always a comma separated list of strings Strings should be outputted ...
37
votes
41answers
4k views

Scrabble scorer

Challenge: Take a string of upper or lower case letters as input (optional), and calculate the score that string would get in a game of Scrabble in English. Rules: The score of each letter is as ...
11
votes
40answers
905 views

Isogram checker

Challenge : Given a word, check whether or not it is an isogram. What : An isogram is a word consisting only of letters with no duplicates (case insensitive). The empty string is an isogram. ...
5
votes
17answers
838 views

Solve for N from input string

Challenge : Your job is to find the given number N. Input : You will be given a string in the following form: dN ± Y = X ...
4
votes
3answers
178 views

Print valid arithmetic expressions

Recursively define a "valid arithmetic expression": Any natural number is a valid arithmetic expression. If s is a valid arithmetic expression, then so is ...
9
votes
33answers
1k views

Output some reserved words

For a computer language, a reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label. For other computer languages, keywords can be considered as ...
23
votes
12answers
2k views

Generate Men of Culture

This challenge is inspired by the meme Men of Culture. The meme involves blanking out parts of the original caption, Ah, I see you're a man of culture as well. to make it appear as if the ...
17
votes
19answers
773 views

Ordinal string check

Description : Given a string as input, check if it is a valid ordinal number in English or not. If it is valid return truthy value otherwise return falsy value. (Suggested by @Arnauld. Thanks . Also ...
0
votes
0answers
81 views

cardinal numbers into ordinal numbers [duplicate]

Description : Given an input (a string , array , integer) , Your job is to append one of the following to it. st , nd , rd , th . Examples : ...
44
votes
44answers
4k views

Make a Word Icicle

Due to technical limitations of Stack Exchange, the title is rendered incorrectly. The correct title for this challenge is Make a ...