Weight Problem
Ravi Kumar
ra21vi at gmail.com
Sat Mar 15 16:57:36 EDT 2008
An Interesting problem,
"""
A man has only 4 bricks of different weights, lies between 1-40KG,
Also, the total weights of Brick A, B, C, D (ie A+B+C+D) is 40KG.
The man uses that brick to calculate every possible weight
from 1 KG to 40 KG in his shop. (only whole numbers 1KG, 2KG etc, not like
2.3KG)
"""
I thought it would really be good to solve it by python, and right now on
the mid-way solving using very dirty approach.
But I feel, using SETs with python in such would solve it better.
Can anyone come with good solution, and maybe solution showing usage of
Sets.
--
-=Ravi=-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080316/d12aa4a6/attachment.html>
More information about the Python-list
mailing list