URL to challenge:
This puzzle isn't too difficult. Having said that though, my solution isn't too elegant. I generally do all of these puzzles/challenges in PHP, which is a language I know through and through, however I've decided to start using Python instead. There's no doubt features of the language and functions I'm not properly utilising, but in time I hope to remedy this.Code:http://www.facebook.com/careers/puzzles.php?puzzle_id=20
If you have a solution, please post it, as I'd love to read through it.
Spoiler:
Results 1 to 13 of 13
-
12-04-2011 09:02 AM #1
- Join Date
- Oct 2009
- Posts
- 1,016
- Rep
- 255
Facebook Puzzle Challenge - Liar Liar - Difficulty Easy
Last edited by Artificial; 12-09-2011 at 10:59 PM.
12-08-2011 12:30 AM #2
Not goin' to lie, this is harder than it seems haha, Working on it in Java since I'm trying to learn it. I'll post up my sources when I finish it.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-09-2011 11:03 PM #3
- Join Date
- Oct 2009
- Posts
- 1,016
- Rep
- 255
I enjoyed it. The trick with these sort of things is to think through how you'd do it yourself, and then just write an algorithm automate it.
Let me know when you've finished. I've had a brief look at their next puzzle (breathalyzer), and it looks interesting, so I'll probably do it either today or tomorrow. Either way, looking forward to seeing your solution.
12-10-2011 04:02 PM #4
Ill be sure to finish it up tonight then after I finish some other software I've been working on.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-15-2011 06:54 AM #5
- Join Date
- Oct 2009
- Posts
- 1,016
- Rep
- 255
I take it then, you did not succeed?
12-16-2011 10:53 PM #6
Nah, Havnt had time between making bank and school.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-17-2011 03:12 AM #7
Scenarios Alex made over Skype:
Solution:Code:5 George 1 Isaac Stephen 1 Galileo Galileo 1 Tommaso Tommaso 1 Galileo Isaac 1 Galileo
Code:3 2
Solution:Code:8 John 1 Tony Jane 1 Ricky Tony 1 Matt Mark 1 Ricky Brad 1 Johnson Matt 1 Brad Ricky 1 John Johnson 1 Ricky
Code:5 3
---------- Post added at 11:12 PM ---------- Previous post was at 10:27 PM ----------
Mine:
Short Version:
Spoiler:
Commented Version / Kinda Readable version.
Spoiler:Last edited by MattSmith; 12-17-2011 at 05:19 PM.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-17-2011 10:25 AM #8
- Join Date
- Oct 2009
- Posts
- 1,016
- Rep
- 255
Nice solution, poor readability though!

Although technically you didn't meet the input requirements. Tsk tsk.
12-17-2011 01:43 PM #9
12-17-2011 04:26 PM #10One of the gang
- Join Date
- Feb 2011
- Posts
- 262
- Rep
- 23
12-17-2011 05:20 PM #11
Possibly Ill write one up later. There are atleast 3 ways me and alex have thought of over skype to do this. I'll probably do a tutorial on how I wrote mine. As of right now, these are CHALLENGES for a reason.
---------- Post added at 01:20 PM ---------- Previous post was at 01:06 PM ----------
Alright, updated my post with my source and added one that you can read. Undid all my lambda and such. Slightly more readable. Kinda messy though.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-17-2011 09:00 PM #12
Check out the difficulty ratings on all the puzzles:
Engineering Puzzles | Facebook
Im doing this one now:
Code:http://www.facebook.com/careers/puzzles.php?puzzle_id=8
Last edited by MattSmith; 12-17-2011 at 09:04 PM.
GET RID OF JOSEPH KONY!
Follow My Dev Blog!
Originally Posted by Artificial
Originally Posted by Artificial
12-17-2011 09:16 PM #13
- Join Date
- Oct 2009
- Posts
- 1,016
- Rep
- 255
It's actually very easy if you first do it manually. On a piece of paper/whiteboard, create two columns and write down the accuser's name in left hand column and who they're accusing in right hand column. From there, try to figure out who is lying and who is telling the truth (I'll give you a hint - it's not too important who you identify as the liars and whose telling the truth - there's a reason they asked you to output the numbers of the two groups as opposed to the individuals in the two groups).
If you can do it manually, you just have to write an algorithm to automate it.
Tags for this Thread



Reply With Quote





Bookmarks