Linked Questions

5
votes
12answers
666 views

Check the jumbled words [duplicate]

This is an easy one. Anagrams are words which have the same characters but in different order. All you have to do is to figure out if two strings are anagram or not. Rules: Take two strings as a ...
2
votes
4answers
119 views

Check if a string is the anagram of another [duplicate]

Skat I'm a fan of anagrams, so given two strings s1 and s2 write a program or function that outputs a truthy value if ...
3
votes
1answer
168 views

Check if input is permutation of source [duplicate]

Inspired by Input ∩ Source Code. Task Your task is to determine whether the input is a permutation of the source code. Input A string. Input is flexible; it should be able to handle the character ...
132
votes
49answers
22k views

Tips for golfing in C

What general tips do you have for golfing in C? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C (e.g. "remove comments" is not an ...
84
votes
38answers
19k views

Tips for golfing in Java

Are there any useful shortcuts that can be used in Java? As shown below, import already adds at least 17 characters to a program. ...
54
votes
17answers
4k views

Tips for golfing in R

I'm looking for tips for golfing in the R statistical language. R is perhaps an unconventional choice for Golf. However, it does certain things very compactly (sequences, randomness, vectors, and ...
35
votes
32answers
2k views

Manage Trash So

It's become somewhat of a tradition in PPCG that some users temporarily change their names by an anagram (a new name formed by reordering the letters of the old). Sometimes it gets difficult to find ...
22
votes
42answers
6k 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 ...
24
votes
16answers
2k views

Monday Mini-Golf #3: Anagram distance

Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday. (Sorry this one's a little late.) I'm sure most of you folks have heard of Levenshtein distance, an ...
14
votes
17answers
4k views

Shuffle a deck without local variables [closed]

The object of this puzzle is to take a deck of 52 cards and shuffle it so that each card is in a random position. Given: An array, deck, of 52 distinct integers ...
13
votes
11answers
2k views

Compute the first N digits of e

Challenge Write a program to compute the the first N (<= 10^3) digits of e. Your program should take an integer N as input. Input: 100 Output: ...
6
votes
4answers
780 views

Let's play countdown!

For those of you who have seen the popular daytime TV show Countdown, you will know that the contestants are given 9 randomly selected letters and must then find the longest word they can in 30 ...