## Puzzles

**Google Code Jam 2008**

- Practice: Alien Numbers [Difficulty=Easy]
- Practice: Always Turn Left [Difficulty=Medium]

- Qualification: Saving the Universe [Difficulty=Easy]
- Qualification: Train Timetable [Difficulty=Medium]

- Round1A: Minimum Scalar Product [Difficulty=Easy]
- Round1A: MilkShakes [Difficulty=Medium]
- Round1A: Numbers
**[Difficulty=Super Nasty]**

- Round1B: Crop Triangles [Difficulty=Medium]
- Round1B: Number Sets [Difficulty=Medium]
- Round1B: Mousetrap

- Round1C: Text Messaging Outrage [Difficulty=Easy]
- Round1C: Ugly Numbers [Difficulty=Hard]
- Round1C: Increasing Speed Limits

**Bit Twiddling**

- Counting Bits in an Integer (Hamming Weight)
- Determining if a number is a power of 2
- Negative Numbers in One's and Two’s Complement

**Prime Numbers**

- Fastest Way to Determine if a Number is Prime
- Fastest Way to Generate Prime Numbers
- Finding the Next Prime Number Greater than X

**General Programming**

- Swapping 2 Integers
- Finding "Perfect Squares"
- Efficient Shuffling (Fisher Yates)
- Intersection of 2 Arrays
- Efficient Joins (Nested Loop, Sort-Merge, Hash)
- Print out the first N Fibonacci Numbers
- Efficient Sorting
- In-Memory Sorting of a Large List
- Efficient Multiplication of Integers (Karatsuba, Toom-Cook, Strassen)
- Explain the Differences between Arrays and Linked Lists
- Find the Middle of a Linked List
- Perform a Deep Copy of a Linked List
- Reverse a Linked List
- Recursively Reverse a Linked List
- Detecting Loops in Linked Lists
- Reversing a String
- Array Multiplication Puzzle
- Implement a stack data structure that can also report the minimum element in constant-time
- Creating a String Representation of an Integer
- Convert a String to a Signed Integer
- Reverse an Array In-Place
- Find the Minimum Without Using If
- Implement the Burrows-Wheeler Transform
- Get 2 Threads to Start Concurrently
- Wait for All Background Threads to Finish
- Determine the Angle Between the Clock Hands
- Efficient Exponentiation
- Finding all Permutations of a Set
- Implement Divide without the Divide Operator
- Dining Philosophers
- 8 Queens

**Google Code Jam 2009**

- Qualification: Alien Language [Difficulty=Easy]
- Qualification: Welcome to CodeJam [Difficulty=Easy]

- Round1A: Multi-base Happiness [Difficulty=Easy]
- Round1A: Crossing the Road
- Round1A: Collecting Cards [Difficulty=Medium]

- Round1C: All Your Bases [Difficulty=Easy]
- Round1C: Bribe the Prisoners [Difficulty=Medium]

- Round 2: Crazy Rows [Difficulty=Easy]

**Google Code Jam Africa 2010**

- Qualification: Store Credit [Difficulty=Easy]
- Qualification: Reverse Words [Difficulty=Trivial]
- Qualification: T9 Spelling [Difficulty=Trivial]

**Google Code Jam 2010**

- Qualification: Snapper Chains [Difficulty=Easy]

**Logic**

- Census taker and the 3 children.
- Stepping Stones
- Find the Missing Number in the Array
- Two Missing Numbers in an Array
- Find the Lightest Box
- Optimal File Location on Sequential Access Device
- The Classic 2 Egg Drop Problem
- The Reckless Skateboarder
- Two Man Money Grab
- Algorithm to Detect an Infinite Loop in a Program

**Project Euler**

**Probability**

- Perfect Bridge Hand
- Biased Coin
- Russian Roulette
- Random Number Generators
- Drunken Airline Passenger
- Circular Permutations
- Birthday Paradox #1: Common Birthday Months
- Birthday Paradox #2: You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?
- If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)?
- Monty Hall Problem