Photo Credit : Helen Morgan
The Third and final problem of the Facebook Qualification 2011 Round was Studious Student. The problem goes like this:
You’ve been given a list of words to study and memorize. Being a diligent student of language and the arts, you’ve decided to not study them at all and instead make up pointless games based on them. One game you’ve come up with is to see how you can concatenate the words to generate the lexicographically lowest possible string.
Continuing with my earlier solution of the First Problem â€œDouble Squareâ€, here is solution and analysis for Second Problem â€œPeg Gameâ€
At the arcade, you can play a simple game where a ball is dropped into the top of the game, from a position of your choosing. There are a number of pegs that the ball will bounce off of as it drops through the game. Whenever the ball hits a peg, it will bounce to the left with probability 0.5 and to the right with probability 0.5.
A lot of people have participated and qualified in Qualification Round of Facebook Hacker Cup. Luckily I am also qualified for First Round. Facebook Hacker Cup Qualification Round consisted 3 problems. All of these problems were programmatically easy but tricky. Lots of people made very simple mistakes while solving these problem(including me).
First Problem of the round was:
A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 32+ 12.