Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [string]

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

15 votes
16 answers
2k views

Reduce a string up to idempotency [closed]

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
  • 6,189
3 votes
1 answer
162 views

How comparison-heavy is this list? [closed]

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
17 votes
14 answers
2k views

Simulate Text Cursor

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
  • 1,081
9 votes
12 answers
3k views

Keyboard Ping Pong

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
26 votes
38 answers
2k views

Segments of a string, doubling in length

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
241 views

Write a function that takes an input string and encodes it using a modified Fibonacci sequence in reverse [closed]

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
-1 votes
3 answers
475 views

Sum of Positive and Negative Powers of 2

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
19 votes
22 answers
1k views

Find characters common among all strings

Find characters common among all strings You are given multiple Strings as an input. Your task is to find the characters that are present in every string, and ...
Mark's user avatar
  • 299
7 votes
7 answers
595 views

Build the first 6 letters of an Italian codice fiscale (tax identification number)

Given a single string with a person's name and surname, output the first 6 characters of their codice fiscale. Codice fiscale Codice fiscale is a 16-character long alphanumeric string that identifies (...
Nicola Sap's user avatar
  • 3,684
20 votes
30 answers
2k views

Break a word into vowels and consonants

Objective Given an string \$n\$, output two strings, namely the string consisting of vowels "a", "e", "i", "o", and "u", and the string consisting of ...
Arunabh's user avatar
  • 311
14 votes
8 answers
1k views

Compare two strings, with NaC

I just thought of this idea: if we have NaN ("not a number") for floats, how about NaC ("not a character") for a single unknown character in a string? Your input should be two ...
3-1-4-One-Five's user avatar
9 votes
14 answers
820 views

Convert CSV tables to MediaWiki tables

Input a CSV table, like this: data00,data01,data02,...,data0m data10,data11,data12,...,data1m ... datan0,datan1,datan2,...,datanm The cells in the CSV table is ...
None1's user avatar
  • 1,115
21 votes
14 answers
3k views

Cold Bee and Old Beer

Introduction: Inspired by this silly meme video, which states 'COLD BEER', but is slightly too large for the scrolling advertisement board, causing it to display either 'COLD BEE' or 'OLD BEER' ...
Kevin Cruijssen's user avatar
14 votes
5 answers
1k views

Decode a Caesar ciphertext with high probability

Caesar ciphers A Caesar cipher with shift=N is the process of replacing any alphabetic character in a string with the letter which is N positions ahead in the alphabet (wrapping back at the beginning)....
Nicola Sap's user avatar
  • 3,684
13 votes
13 answers
2k views

Compute the degree of a string

The input is a string made of the letters a,b,c only. The output is an integer representing the degree of the sequence. The degree of a sequence is computed as follows: Assume that each of the ...
Erel Segal-Halevi's user avatar

15 30 50 per page
1
2 3 4 5
148