Monday, June 09, 2008

Solutions to Google Treasure Hunt

About a month ago, Google launched the Google Treasure Hunt challenge with the following code:
Solution: base64 decode

Note: The Google Treasure Hunt page is built on Google's App Engine platform.

Solution to Problem 1:

Problem 1 is a standard pascal's triangle kind of problem involving big numbers.
My solution is in C.

Solution to Problem 2:

For this problem, you need a bash shell. Modify this script accordingly...

Solution to Problem 3:

Problem 3 is relatively easy, once you get the definitions right. It can even be done using pen and paper! You need to understand that "A.B.C.D=>W.X.Y.Z" means if your destination IP is A.B.C.D, then your next target IP is W.X.Y.Z. Also, "A.B.C.0/24" means "A.B.C.*"

This is my solution in C.

Solution to Problem 4:

I used the bigint class for this problem. This question is the toughest among the 4 questions. You may even need to generate up to 90000 prime numbers to solve it. (if you have a better solution, please share...)

This is my solution in C++. Takes minutes to generate the solution. So pls be patient.


Anonymous said...

There are lists of prime numbers out there.

With a little perl-fu you get a considerable big prime number list.

Mine is 250MiB :D

Anonymous said...

Sorry for double-post :)

My perl solution takes 10sec and max. 50MiB RAM. I'm proud.

Anonymous said...

Ahh, man, sorry for posting again but the robot-problem is just

minghan said...

Yes. I understand its combinatorics.

mauro said...

I think my solutions for q1 and q4 are quite simple and original... expecially q4 runs in few seconds using little memory
I don't know how to post indented code so here's a link