Question: CODE IN PYTHON ONLY Given a set of weights 11,3,9,27), show that you can construct any number between 1 and 40. In other words, using

CODE IN PYTHON ONLY

CODE IN PYTHON ONLY Given a set of weights 11,3,9,27), show that

Given a set of weights 11,3,9,27), show that you can construct any number between 1 and 40. In other words, using the set above and the addition and subtraction operations, construct any integer between 1 and 40 without re-using elements. For example, 4 = 1+1+1+1 is not acceptable. For example, 8=9-1 10- 19 Hint: see the itertools module. Your function should return a 4-element list of the decomposition. For example, your return value given input 10 should be 1,0,1,01 becase 1* 03+ 9127*0-10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!