Linked Questions

10
votes
23answers
524 views

caN it be acrOnymised? [duplicate]

The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random ...
1
vote
0answers
155 views

Is one string contained within the other? [duplicate]

Given two inputs, you should print or return whether the characters in the first string are - in order - inside the second string. For example, we want to check whether the string ...
300
votes
158answers
110k views

Tips for golfing in Python

What general tips do you have for golfing in Python? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Python (e.g. "remove comments" is ...
86
votes
138answers
12k views

Determine whether strings are anagrams

Challenge Given two strings, work out if they both have exactly the same characters in them. Example Input word, wrdo This returns true because they are the ...
69
votes
24answers
8k views

Crack the bank account's password!

Introduction In order to prevent keyloggers from stealing a user's password, a certain bank account system has implemented the following security measure: only certain digits are prompted to be ...
32
votes
16answers
6k views

Is it a lobster number?

Introduction A "lobster number", by my own designation, is a number that contains within itself all of its prime factors. The "lobster" description was inspired by the recent ...
20
votes
19answers
2k views

Vandalizing Marquees

A marquee is a low-tech board that allows customizable letters. For example, here is a marquee: SALE ON SNEAKERS However, someone might come along and vandalize it ...
20
votes
7answers
1k views

Is this a submatrix?

This is the 2-dimensional generalisation of this challenge. For our purposes, one matrix (or 2D array) A is considered a submatrix of another matrix B, if A can be obtained by completely removing a ...
3
votes
19answers
578 views

Filter this string!

Your task is to write a program that will filter out some characters in a string, so that the remaining spells out (part of) the other string. Let's say we received the string "...
4
votes
5answers
470 views

How many times is rectangular array A embedded in rectangular array B?

Given two rectangular arrays, A and B, let's say that A is embedded in B if A can be obtained from B by deleting some (or none) of the rows and columns of B. Write a program with the following I/O: ...
12
votes
2answers
347 views

How many mesas begin with a given string?

Let's call a non-empty list of strings a mesa if the following conditions hold: Each listed string is non-empty and uses only characters that occur in the first string. Each successive string is ...