« Google treaure hunt | Evolution of a blogger »

Google treasure hunt (Second puzzle)

Its about time (936266827 seconds before Y2K38) i.e 19may2008 17:07:58 (UTC) and the second puzzle is live (Check it out). You can still try the first question here. Second puzzle from google treasure hunt is to calculate

Sum of line n for all files with path or name containing pattern and ending in particular extension. Similarly Sum of line m for all files with some pattern.
Hint: If the requested line does not exist, do not increment the sum.
Multiply all the above sums together and enter the product below.

for a given set of files contained in a zip archive. I have already submitted my answer :) , but this time I will have to wait for 24hrs to check the status of my answer :( . I thinks its a good puzzle to test your quick shell script abilities. (Can also be done easily in perl/python).

For the solution part, I wont give the actual solution (As dont want it to spoil for others who are actually trying) but you can use shell commands [grep, find ,sed and pipe (|)] to get to solution. You can get all the required numbers in 2 lines on shell.

Related Post:
Google Treasure Hunt
Orio’s Riddle Completed
Twisty Puzzles

Comments

9 Responses to “Google treasure hunt (Second puzzle)”

  1. T-Ray on May 19th, 2008 8:43 pm

    May I ask what the time stamp is on your submission? Thanks.

  2. burad on May 19th, 2008 8:50 pm

    its 2008-05-19 17:51.. why did you asked ?

  3. T-Ray on May 19th, 2008 10:31 pm

    Sweet! I beat you ;) My submit time was 2008-05-19 17:46:47.788098. I was concerned because I was surfing while waiting for the start time and became distracted - which caused me to start 3 min late.

    I did mine in Java as forgot about shell scripts. That might have been faster to write.

    Cheers.

  4. burad on May 20th, 2008 5:03 am

    good..but yeah with shell scripts its really fast only one line.
    Actually I forgot about treasure hunt, as was watching a movie.

  5. Dimitar Peev on May 20th, 2008 7:01 am

    I am sorry boys:
    Time received: 2008-05-19 17:24:38.157664 UTC
    But yet, we will have to wait and see if it is right :)

  6. Sujoy Adhikary on May 20th, 2008 7:32 am

    Actualy friends I stay in India and I get access to internet at 10.30 in the morning. So I replied at 2008-05-20 05:27:55.247648 UTC

    However friends, I did not find any twist or difficulty in this question. Like in teh previous puzzle the answer could not contain in a 64 bit variable.

    Regards,
    Sujoy Adhikary

  7. Egal on May 20th, 2008 8:22 am

    I know, this might be regarded lazy, but I found it easier to use search on this one. Formed a boolean query with some wildcards… ultimately gave me the same solution as my script :)

  8. burad on May 20th, 2008 5:10 pm

    And my answer is correct :) . Though this was not that difficult of a question.

  9. Puzzle puzzle every where : Burad’s Blog on June 7th, 2008 7:24 pm

    […] puzzle/problem solving weeks, which includes 4 google treasure hunt problems. (Robot in a Maze, Puzzle 2 (getting lines from specific files in zip archive), Network routing table and last one:Prime numbers ). Solving these was fun. puzzle Two days back my […]

Leave a Reply