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)”
Leave a Reply
Add to del.icio.us Network
Google Reader Shared Items
Twitter Feed
Flickr Photos
May I ask what the time stamp is on your submission? Thanks.
its 2008-05-19 17:51.. why did you asked ?
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.
good..but yeah with shell scripts its really fast only one line.
Actually I forgot about treasure hunt, as was watching a movie.
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
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
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
And my answer is correct
. Though this was not that difficult of a question.
[…] 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 […]