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

learn more… | top users | synonyms

-4
votes
0answers
56 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
191 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: ...
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 ...
-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 ...
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 ...
9
votes
22answers
839 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 ...
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 ...
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
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 ...
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. ...
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) ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
-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
541 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 ...
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 ...
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 ...
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 ...
6
votes
3answers
380 views

Parse a Python string literal

The challenge is to parse a string like Python does and print the contents of the string. Input (command-line argument or stdin): a string literal (e.g. "hello") (or multiple literals, see string ...
-3
votes
2answers
355 views

Strings: Microsoft interview

You are given an array of strings , you have to construct a single array containing all of them so that the same array of strings can be reconstructed from the large array. The strings may contain any ...
9
votes
1answer
434 views

Fix unbalanced brackets

Consider the alphabet A ="()[]{}<>". Think of the characters in the alphabet as opening and closing brackets of 4 different types. Let's say that a string over the alphabet A is balanced if it ...
21
votes
6answers
1k views

Shortest common superstring

Given a list of strings s_0, s_1, ..., s_n find the shortest string S that contains each of s_0, s_1, ..., s_n as a substring. Examples: S('LOREM', 'DOLOR', 'SED', 'DO', 'MAGNA', 'AD', ...
1
vote
7answers
695 views

Alien Name Generator [closed]

Task Write a function to generate names of aliens and their worlds, so that the output is of the form: Greetings Earthfolk, I am ____ of the planet _____. "Rules" Best space-sounding-ness to code ...
3
votes
4answers
245 views

Count characters in lo..ol and print a phrase [duplicate]

Assuming 'lol' with a variavle number of 'o's. Print a the following phrase: What does 1st, 2nd, 3rd, 4th ... 'o' stand for? Examples: lol -> What does 1st 'o' stand for? loooool -> What ...
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 ...
5
votes
12answers
594 views

Output code-sized text

Output the same length of Lorem ipsum your code is! Rules: length is bits/8 length has to be positive code can't be identical to output no compression library shortest or super creative program in ...
8
votes
2answers
541 views

Email validation

Write a function or program to validate an e-mail address against RFC 5321 (some grammar rules found in 5322) with the relaxation that you can ignore comments and folding whitespace (CFWS) and ...
8
votes
5answers
258 views

Arbitrary-Length Ternary Squarefree Words

A string is squarefree if it contains no substring twice in a row. It is possible to have an arbitrarily long squarefree word using a 3-letter alphabet. Write a program which accepts a positive ...
5
votes
8answers
464 views

Cambridge Transposition

I'm sure most, if not all, of you have come across this at some point or another: Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, ...
3
votes
8answers
436 views

Find The Least Common Characters

Given a string, find the 10 least common alpha-numeric characters within that string. Output should be formatted with numbers left-padded with spaces so they look like this: e: 1 t: 16 c: ...
4
votes
9answers
554 views

Ode-cay Olf-gay

Write a program which accepts a sentence into stdin, and writes that sentence to stdout in pig latin. Here are some test cases which your program should handle: Input: Read your script Output: ...
-6
votes
2answers
398 views

Implementing a Traffic Light Checker [closed]

A three-color traffic light must switch lights in the following order: red, green, yellow, red. To indicate when crossing slowly without a stop is permitted, the yellow signal may be flashed. To ...
0
votes
2answers
219 views

Storing a DNS name as compactly as possible in memory (preferably in C#) [closed]

What is the most compact way to encode/save DNS names in memory? For example, storing "www.google.com" as a string in .NET will result in the object being encoded as UTF-16, and it will consume twice ...
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 ...