Facebook Hacker Cup Qualification Round

Well after receiving an influx of hits I have decided to remove the source code from the Facebook Hacker Cup Studious Student contest. I will be posting the code after the qualification round completes.

However, I will try to decompose the problem a bit to help other students solve it. Like any good computer science problem you need to first decompose this one into its parts. Instead of trying to approach the entire problem lets just try to focus on solving the problem for one line.

Take the line: "5 this is a generic line"

If you were given this string there are five things we need to do to it:

  1. Identify how many words are on the line
  2. Create some structure and store each word in the structure
  3. Sort that structure
  4. Concatenate and return that structure
Now if you have this completed, you simply need to run this routine on each line in the file sans the first one. This will give you the result output. 

If one was interested they might start looking in the Java API under String, and Scanner

0 comments: