Linked Questions

41
votes
64answers
3k 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 ...
61
votes
46answers
11k 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 ...
29
votes
61answers
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. ...
42
votes
33answers
3k 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? ...
26
votes
35answers
5k 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] ...
18
votes
52answers
6k 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 ...
26
votes
35answers
2k 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 ...
21
votes
22answers
2k views

Simplify a continued fraction

Continued fractions are expressions that describe fractions iteratively. They can be represented graphically: Or they can be represented as a list of values: ...
12
votes
23answers
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 ...
21
votes
18answers
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 ...
12
votes
21answers
3k 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: ...
29
votes
8answers
3k views

Are you in the biggest room?

Introduction You have recently accepted a job offer at a Pretty Good Software Company. You're pretty content with the size of your office, but do you have the biggest office? Its kinda hard to tell ...
17
votes
8answers
1k views

RNA to Protein Translation

RNA, like DNA, is a molecule found in cells encoding genetic information. It consists of nucleotides, which are represented by the bases adenine (A), cytosine (C), guanine (G) and uracil (U).* A codon ...
16
votes
7answers
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: ...
16
votes
7answers
2k views

Typing with scrambled keys

Your friend isn't too good with computers so as a practical joke someone scrambled the letters (a-z) on his keyboard. When he sit down and tried to type his name looking at the keyboard he realized ...

15 30 50 per page