Has anyone else attempted any of these Facebook programming puzzles? Location: http://www.facebook.com/jobs_puzzles/index.php
I've submitted several of them but finally got stuck on one. They're pretty fun, though.
I'm stuck on this one, btw: http://www.facebook.com/jobs_puzzles/index.php?puzzle_id=2
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.
Quote from: sdfg on February 15, 2009, 08:27:05 AM
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.
This is rather vague. The part you mentioned is obvious.
This is basically a variant on the subset sum problem. I would imagine that dynamic programming would probably be the way to go. (Yes, I realize this is vague too. :))
This is pretty neat. :)
Quote from: Sidoh on February 15, 2009, 01:16:58 PM
Quote from: sdfg on February 15, 2009, 08:27:05 AM
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.
This is rather vague. The part you mentioned is obvious.
This is basically a variant on the subset sum problem. I would imagine that dynamic programming would probably be the way to go. (Yes, I realize this is vague too. :))
Yea. That's what I basically concluded last night and have been doing some reading on it. I'm going to make another attempt at it soon. Hopefully I don't spend hours on it like I did on some of the others.
Sdfg, your response was pretty obvious. That's pretty much what the exact problem says to do. The word problem isn't where I was stuck, heh.
Hehe, yeah. There's a "pseudo-polynomial" dynamic programming solution to the subset sum decision problem, but it's worth noting that it's still an NP-complete problem.