Linked Questions

48 votes
83 answers
4k views

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
  • 104k
63 votes
46 answers
12k views

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
29 votes
61 answers
7k views

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.3k
32 votes
46 answers
8k views

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
4k views

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
3k views

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.8k
20 votes
57 answers
7k views

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
9k views

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
4k views

Print the ASCII printable character set

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

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,054
22 votes
24 answers
5k views

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,249
13 votes
23 answers
2k views

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
5k views

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
4k views

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
1k views

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