Linked Questions

48 votes
83 answers

Type uniqchars!

Given a string consisting of printable ASCII chars, produce an output consisting of its unique chars in the original order. In other words, the output is the same as the input except that a char is ...
Luis Mendo's user avatar
  • 105k
63 votes
46 answers

Make your language *mostly* unusable! (Cops' thread)

Inspired by this comment... Thanks to users Step Hen, Wheat-Wizard, and Dennis for helping my solidify the specification of this challenge before posting it! This is the Cops' thread. For the ...
DJMcMayhem's user avatar
  • 59.3k
29 votes
61 answers

Two Makes All The Difference - Robbers

For the main cops' challenge, click here NOTICE - This challenge is now closed. Any cracks which are posted now will not be counted on the leaderboard and the accepted answer will not change. ...
Beta Decay's user avatar
  • 23.4k
32 votes
46 answers

Mode (most common element) of a list

Write a snippet to calculate the mode (most common number) of a list of positive integers. For example, the mode of d = [4,3,1,0,6,1,6,4,4,0,3,1,7,7,3,4,1,1,2,8] ...
garg10may's user avatar
  • 709
44 votes
34 answers

Tips for golfing in CJam

CJam is a GolfScript-inspired stack-based golfing language, created by PPCG user aditsu. So, in the vein of other language-specific tips questions: What general tips do you have for golfing in CJam? ...
Martin Ender's user avatar
34 votes
48 answers

Output the hours at 90 degrees

Today while playing with my kids I noticed that an apparently simple toy in the park hid a challenge. The wheel has a triangle that points to a number, but also has three circles that point to the ...
Charlie's user avatar
  • 12.9k
20 votes
57 answers

Random ticket code generator

A lottery company wants to generate a random lottery ticket number of length 10 characters. Write a code in any language to create such a number in which every digit comes only once for example ...
Ankush's user avatar
  • 379
26 votes
43 answers

Make me speak L33T

I want to be down with the kids of the 1990's and start speaking this L33T speak of their's. For any given input I would like the resulting L33T speech as an output. I don't want to go to far down ...
Matt Bartlett's user avatar
11 votes
87 answers

Print the ASCII printable character set

Challenge: Print the entire printable ASCII charset (not just a range!) in order. ...
anna328p's user avatar
  • 6,396
19 votes
42 answers

Partial Sum of Harmonic Sequence!

Definition In Mathematics, Harmonic Sequence refers to a sequence where $$a_n = \frac 1 n$$ i.e. the \$n_{th}\$ term of the sequence equals the reciprocal of \$n\$. Introduction In this challenge, ...
Arjun's user avatar
  • 5,074
22 votes
24 answers

Simplify a continued fraction

Continued fractions are expressions that describe fractions iteratively. They can be represented graphically: $$ a_0 +\cfrac 1 {a_1 + \cfrac 1 {a_2 + \cfrac 1 {\ddots + \cfrac 1 {a_n} } ...
Aaron's user avatar
  • 1,259
13 votes
23 answers

An improved version of GolfScript [closed]

I am planning to write an improved GolfScript for even shorter programs that can do more things. This is not a challenge; it is a request for feedback and tips on what I should do. (see tags) I'm not ...
22 votes
18 answers

Find nearest number in a given array

This is inspired by a real world problem I had. I'm curious to see if there is any clever way to go about this. You are given two unsorted arrays, A and B, each containing an arbitrary number of ...
Orhym's user avatar
  • 323
14 votes
27 answers

Sort the distinct elements of a list in descending order by frequency

Write a function which takes a list or array, and returns a list of the distinct elements, sorted in descending order by frequency. Example: Given: ...
Belvi Nosakhare's user avatar
20 votes
11 answers

Period of the decimal representation

Write a function which takes a single positive integer n and returns the period of the decimal representation of 1/n. Test cases: ...
Howard's user avatar
  • 23.5k

15 30 50 per page