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

learn more… | top users | synonyms

-4
votes
0answers
55 views

Return nth letter from a file [on hold]

Using only the standard libraries of the programming language, write a program to do the following: Accept two inputs: a text file and an arbitrary positive integer n. Returns the nth letter from a ...
-3
votes
4answers
190 views

print text with no chars

Mission is write a program that prints "Hello World!". Simple? Text must be human readable and should not be "|-| € |_ |_ 0 // 0 |? |_ |) \./" or something like that Program should not contain: ...
14
votes
31answers
837 views

Shortest program to split a string at non-digits without RegExps

EDIT: If you're using Lisp, I have given some guidelines at the bottom in counting bytes. Objective: Make the shortest function that splits a string at non-digits and returns an array consisting of ...
45
votes
31answers
13k views

All Your Base Are Belong To Us (Restricted)

Input must not be required, and output must read "All your base are belong to us". Restrictions No external resources. Plus a minimum of two of the following: You cannot use "a", "b", "t", "u", or ...
17
votes
8answers
990 views

One Letter Swap

The largest forum on the web, called postcount++ decided to make a new forum game. In this game, the goal is to post the word, but the word has to have one letter added, removed, or changed. Your boss ...
11
votes
8answers
1k views

Is it a prime? w/o math

Write a program or function in any language that tells if the input is a prime number. The input is a string representing a natural number in base-10. The output is one of the two strings "Prime" or ...
7
votes
16answers
409 views

Sum of integers in string, separated by non-numericals such as 'a' and 'Y'

Create a program which sums all integers found in a string which is set as a variable in the program (thus, the program doesn't have to handle any input). The integer numbers are separated by ...
45
votes
70answers
8k views

Print the alphabet without using each vowel

Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'. Your task is to write a set of (up to 5) programs in any language (which has a ...
9
votes
22answers
838 views

Print a string with vertical words

Your task is to take an input string of ascii characters and output the string as a series of vertical words separated by spaces. An example is shown below: Given the string: Hello, World! My name ...
-5
votes
3answers
212 views

Check if a string only contains 0 and 1 [closed]

When I was a child, I would love to have a robot friend. Today, I start to built it. I want a way to protect my robot from bully's language. Bullies always use a dirty language with a lot a letter, ...
-6
votes
1answer
87 views

Dealing with boolean strings [closed]

you have the following or similar string : () || () || { () || () } && () || { () && () } || and && are used as operators. () indicates of an boolean of that matter.(true or ...
7
votes
31answers
3k views

Is string X a subsequence of string Y?

Given strings X and Y, determine whether X is a subsequence of Y. The empty string is regarded as a subsequence of every string. (E.g., '' and 'anna' are subsequences of 'banana'.) Input X, a ...
13
votes
9answers
896 views

Write a function that returns past tense of given verb

Challenge Write a function which takes an argument which is a verb, and returns the past tense of the verb. (Assume that the verb is regular) Past tense Note: consider y as neither consonant ...
6
votes
17answers
751 views

Write a program for splitting the string with alternative spaces

Want to write a program in minimum number of code,all programming language accepted Runtime criteria also challanged Example: Input : abcdef Output: a b c d e f ab cd ef abc def ...
12
votes
33answers
1k views

Detect rotated strings

Read two strings from stdin. Output Yes if one string is a rotated version of the other. Otherwise output No Testcases Input CodeGolf GolfCode Output Yes Input stackexchange changestackex ...
8
votes
16answers
2k views

Outputting ordinal numbers (1st, 2nd, 3rd)

I would like to generate (as a return result of a function, or simply as the output of a program) the ordinal suffix of a positive integer concatenated to the number. Samples: 1st 2nd 3rd 4th ...
14
votes
1answer
713 views

Create a C preprocessor

The goal is to create a preprocessor for the C language, as small as possible in terms of source code size in bytes, in your preferred language. Its input will be a C source file, and its output will ...
6
votes
8answers
2k views

Find the minimum edit distance between two strings

Explanation The edit distance between two strings is a function of the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. Insertions and ...
9
votes
10answers
460 views

String of alphanumeric characters to a sorted list of comma-separated ranges

Given a string of unsorted alphanumeric characters, e.g. ABC321STPpJqZZr0 output a ", "-separated list of character ranges, sorted by ASCII value, ignoring case and removing duplicates (i.e. ...
16
votes
29answers
2k views

Print custom alphabet

The Challenge Display the alphabet from a given letter read from console input. If the letter is uppercase, you have to display the alphabet uppercased. The alphabet printed must end in the precedent ...
3
votes
7answers
256 views

Longest Common Subsequence of Two Strings containing a particular Substring

A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. Given three strings A, B and C (note the order) ...
8
votes
12answers
578 views

Topographic Strings

Here is some example input, so I can explain what the problem is: ((1 2)(3 (4 5) moo)) (i (lik(cherries)e (woohoo))) Think of this line of text as a topographic map of some mountains. Each set of ...
4
votes
10answers
450 views

Golf an LZW encoder

Given an alphabet and a string, your job is to create the Lempel–Ziv–Welch compression of the string. Your implementation can either be a function with two parameters and a return value, or a full ...
11
votes
9answers
715 views

Create a Twitter Parser

Introduction You use Twitter (let's pretend, if not), where you are limited to 140 characters per individual tweet you care to share with the world. If you wanted to tweet to your followers Abraham ...
4
votes
12answers
562 views

Shortest string expressions stable under deleting quotes

Forgetting quotes can lead to certain problems. For example, in Scala the two expressions: "("+("+")+(")+(")+")" ("+("+")+(")+(")+") differ only in starting and ending quotes, but they ...
7
votes
6answers
260 views

Determine whether a car can get around a route with a limited amount of gas

Using any programming language that supports functions, have the function is_enough(strArr) that take strArr which will be an an array consisting of the following elements: N which will be the ...
-5
votes
3answers
119 views

Shortest code to reverse a string [duplicate]

The winner will be the one to use the shortest code to reverse this string: Today there was two clouds in the sky, each forming a shape. It may be in any programming language.
2
votes
2answers
241 views

Hide one message inside another

Your task is to hide a small message or string inside a larger block of text. To do so, you must hide the message as capital letters inside the larger For the quoted test: Lorem ipsum dolor ...
1
vote
38answers
2k views

Print an n-by-n Box [closed]

Simple problem: print an n by n box from a function. A couple caveats:  -You may not use any loops  -The function must have exactly one parameter of type int (or the equivalent in your ...
1
vote
0answers
77 views

palindrome detection palindrome [duplicate]

Write a function with a single string parameter and a boolean return value. The function should return true iff the string is a palindrome character-wise. Alternatively, write a program that reads a ...
7
votes
7answers
768 views

ASCII ruler generation

The challenge is to generate an ASCII character count ruler in the following format: +-------------------------------------------------------------------------+ || | | | | | | | ...
20
votes
4answers
721 views

9-hole mini-golf: Text Manipulation

9-hole mini-golf: Description 9 (mostly fairly easy) code golfing challenges of varying difficulty Penalties for using the same language more than once All challenges about a specific theme (this ...
10
votes
3answers
212 views

Expand tabs (implement expand(1))

Your task this time is to implement a variant of the POSIX expand(1) utility which expands tabs to spaces. Your program is to take a tabstop specification and then read input on standard in and ...
17
votes
19answers
3k views

Hello world!!! Fibonacci distribution

Your program should output exactly: Hello world!!! with or without linefeed after. Your program should take no input. Sourcecode character distribution must be correct according to: The number of ...
11
votes
29answers
2k views

Reverse stdin and place on stdout

Requirements: Take an input on stdin including new lines / carriage returns of unlimited length (only bounded by system memory; that is, there is no inherent limit in the program.) Output the ...
13
votes
4answers
517 views

Syntax Highlighting for Greater Golf!

Golfers. Together, we have banded together to produce code that is concise, is functionally beautiful and is uglier then the Phantom of the Opera from the original novel. The time has come for us to ...
5
votes
1answer
227 views

Manipulate “RELATIVE” using 8 OP-codes

Rules: Your program can be in any programming language. Your program should not take any input. Your program should transform the word "RELATIVE" into "STATIC". The word can at any stage only ...
4
votes
4answers
154 views

printf-style string formatting

Challenge Write a function that implements C printf-style string formatting. Rules You must implement at least %%, %c, %s, %d and %f. You must not use a built-in string formatting method. You must ...
15
votes
17answers
1k views

Capitalize String

Given a string, capitalize it. By capitalization I mean conTeNT-lENgth changes to Content-Length. In the example I showed the string with 2 words with - as the word boundary. However I expect you to ...
5
votes
26answers
757 views

Run Length Decoding

Write the shortest code in the language of your choice to perform run length decoding of the given string. The string will be supplied as input on stdin in the form CNCNCNCNCNCNCNCN where each C ...
5
votes
4answers
370 views

Cardinal Numbers in Standard American English

Let n be any integer between 1 and 999,999 inclusive. Your challenge is to write a complete program which using stdin or command-line arguments takes in n and outputs the number of times the letter ...
-1
votes
1answer
253 views

Compressing a DNA-like string [closed]

my app is multiple choice test, where for each question the response results in a 4 letter string "eg" GTAC or ATGC or CATG, etc. There are always just 24 questions. so the final result is something ...
0
votes
4answers
426 views

Find the longest word in a sentence without using regex [closed]

Have a function LongestWord(sen) take the sen parameter being passed and return the largest word in the string. If there are two or more words that are the same length, return the first word from the ...
-3
votes
2answers
231 views

Decode obfuscated Hello world [closed]

In the following string (number), there is an hidden message, the goal of this is to find how this message is encoded write the shortest code that permit to retrieve the original message. The only ...
7
votes
5answers
540 views

Given a string find the substring which appears most often

Write a complete program (not just a function) which using stdin takes in a string of arbitrary length (assume string-length at least one) composed only of digits 0-9 and outputs using stdout the ...
14
votes
21answers
1k views

Indent a string using given parentheses

Given the following input to the program: List of block start characters List of block end characters A string to format format the string with the blocks delimited by the two character sets ...
0
votes
3answers
619 views

javascript: smallest code to convert seconds to time [closed]

Given seconds like 11728, write the smallest javascript function that returns a string like 3hrs. 15min. 28sec. signature textTime([int] t,[bool] z,[bool] m) t is the time like 11728 and you can ...
-5
votes
5answers
382 views

Code Golf: simple way to get min & max

This is my first attempt at starting a code golf contest. whats needed is a simple way to get min & max (without using built in max & mix functions, of course, because Perl does not have it :D ...
4
votes
11answers
547 views

Replace letters by their rank, keeping punctuation intact

The problem is simple. Given a string such as "Hello World" the program would output "8-5-12-12-15 23-15-18-12-4-!". Any delimiters will do, (please specify what they are though) I just chose to use ...
11
votes
9answers
608 views

Soundex function

Write the shortest function to generate the American Soundex code for a surname only containing the uppercase letters A-Z. Your function must produce output consistent with all the linked page's ...