Christian Harms's picture

Solutions for the google code jam 2012 qualify round

Google Code Jam 2012 started this weekend and this years qualification round was simpler than other years.Read more

Christian Harms's picture

Facebook hackercup 2012 - round 1 with merge sort

The first round of the facebook hackercup 2012 had three problems. All problems have to be solved in 24 hours and coders with three successful solved entries goes to round 2.

The problem "Recover the Sequence" can be solved in two lines of code (+ some lines for input and output).

Recover the Sequence - problem

Merge sort is one of the classic sorting algorithms. Conceptually, a merge sort works as follows. Divide the unsorted list into n sublists (n is 2 in the example), each containing 1 element (a list of 1 element is considered sorted). Repeatedly Merge sublists to produce new sublists until there is only 1 sublist remaining. (This will be the sorted list.)

The problem description starts with the pseudo code - I translated into a python class.Read more

Christian Harms's picture

facebook Hacker Cup 2012 Qualification - solution for billboards

The second problem from this year facebook hackercup sound like the classic knapsack problem. But the solution is much easier (words are in fixed sort order). Feel free to find a smarter algorithm or comment my python solution.

problem description

We are starting preparations for Hacker Cup 2013 really early. Our first step is to prepare billboards to advertise the contest. We have text for hundreds of billboards, but we need your help to design them.Read more

Christian Harms's picture

facebook Hacker Cup 2012 Qualification Round - alphabet soup

This year qualification round had three problem. The easy one was Alphabet Soup - classic character counting problem.


problem description

Alfredo Spaghetti really likes soup, especially when it contains alphabet pasta. Every day he constructs a sentence from letters, places the letters into a bowl of broth and enjoys delicious alphabet soup.

Today, after constructing the sentence, Alfredo remembered that the Facebook Hacker Cup starts today! Thus, he decided to construct the phrase "HACKERCUP". As he already added the letters to the broth, he is stuck with the letters he originally selected. Help Alfredo determine how many times he can place the word "HACKERCUP" side-by-side using the letters in his soup.Read more

Christian Harms's picture

facebook Hacker Cup 2012 Qualification Round

The facebook hacker cup is a google-code-jam like coding contest - starting with the 2012 qualification round this weekend. Try to solve the 2011 practice round. If you can submit your solution (the spinner after submit dont stops) try to check the result response with HTTPFox (it shows the correct / incorrect response) - hoping this will be fixed for this weekend.

All solutions can be testet with - a fine javascript solution for running code contests like facebook hacker cup or google code jam.Read more

Christian Harms's picture

Q*Bert chrismas tree puzzle

This is a short coding puzzle with q*bert (who is q*bert?) and an chrismas tree.

the qbert question

qbert chrismas tree coding puzzle
The task: Our 2011 q*bert can only jump down. He start from the top and has to find the path to the bottom of the chrismas tree with collecting the most points available (while jumping left-or-right down). Find the way with the highest sum.


  1. chrismasTree = [[75],
  2.               [95,64],
  3.             [17,47,82],
  4.           [18,35,87,10],
  5.         [20, 4,82,47,65],
  6.       [19, 1,23,75, 3,34] ]
  7. print qbertRun(chrismasTree)

The sum is 465 - try to solve it with a little program. The brute force method will be possible with this small tree.Read more

Nico Heid's picture

Automated frontend testing for the lazy. With Firefox, Selenium, Webdriver and Hudson/Jenkins. Now with 50% less programming.

It's hard to find Chuck Norris, therefor we'll use a SeleniumIDE to record a frontend test, fine tune it and deploy it to a headless Hudson instance, so you don't have to look for yourself all the time.Read more

Christian Harms's picture

2011 google Developer Day - all slides and links

After a long saturday in berlin I could write some facts about the talks and list all the news. But the gdd world tour is over and all speaker announced to publish the slides. So I will offer the not-complete list.Read more

Android Chrome & HTML5 Cloud Google+
Android Market for Developers (video)
- Rich Hyndman (G+)
Making Your Web Apps Accessible Using HTML5 and ChromeVox
- Mike West (G+, Twitter blog)
Finding Your Place in the World: Google Places API
- Mano Marks (G+, twitter and blog)
Google+ and the +1 Button
- Ade Oshineye (G+, twitter and blog)
Matthias Reuter's picture

On the phone with Mom - Throttle and Delay DOM-Events in Javascript

Imagine you're on the phone with your mom and she keeps on talking. And talking. And talking. And you keep on listening and listening. And listening. Every now and then your mom will throw in a "you still there?" to which you will murmur "uh huh".

And while your mom keeps talking, you feel the increasing urge to answer to something she said, but being well raised, you don't want to interrupt her, but wait until she is finished.

Now imagine being a Javascript (Come on, It's not that hard, is it?).Read more

Christian Harms's picture

Snow is falling - code puzzle

Code puzzles are fun and you can solve it with some lines of code. The code puzzle on is a page showing snow is falling up instead down. After reading the code, sleeping two nights without time to solve it, the simple solution is easy:

  1.   init : function(law){
  2.     String.prototype.reverse=function(){return this.split("").reverse().join("");}
  3. = {};
  4.     for (var k in law) {[k.reverse()] = law[k]; };
Read more

Syndicate content