07-01-2008
19,
0
Join Date: Nov 2005
Last Activity: 23 September 2013, 11:54 AM EDT
Posts: 19
Thanks Given: 0
Thanked 0 Times in 0 Posts
logic question
Hi, this is logic question, not sure anyone can answer
I have 5 balls, and balance in front of me, this 5 balls look the same, but one of them is heavier, I need to use balance to find the heavier ball
my approach is take any 2 balls, 2 balls in each side of balance, if the weight the same, then fifth ball is the answer, if one of the two balls group is heavier, then take each ball from that 2 balls group to each side of balance, the heavier one is the answer .
can we write it programatically with unix or perl?
Thanks
Chris