Facebook Hacker Cup : Studious Student Problem Solution

Photo CreditPhoto Credit : Helen Morgan

The Third and final problem of the Facebook Qualification 2011 Round was Studious Student. The problem goes like this:

Studious Student

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.

Read More …

Facebook Hacker Cup : Peg Game Problem Solution

Continuing with my earlier solution of the First Problem “Double Square”, here is solution and analysis for Second Problem “Peg Game”

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.

Read More …

Facebook Hacker Cup : Double Squares Problem Solution

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:

Double Squares

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.

Read More …