Problem Statement | |||||||||||||
You have been given a list of jewelry items that must be split amongst two people: Frank and Bob. Frank likes very expensive jewelry. Bob doesn't care how expensive the jewelry is, as long as he gets a lot of jewelry. Based on these criteria you have devised the following policy:
values = {1,2,5,3,4,5}Valid allocations are: Bob Frank 1,2 3 1,3 4 1,4 5 (first 5) 1,4 5 (second 5) 2,3 5 (first 5) 2,3 5 (second 5) 5 (first 5) 5 (second 5) 5 (second 5) 5 (first 5) 1,2,3,4 5,5Note that each '5' is a different piece of jewelry and needs to be accounted for separately. There are 9 legal ways of allocating the jewelry to Bob and Frank given the policy, so your method would return 9. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | values will contain between 2 and 30 elements inclusive. | ||||||||||||
- | Each element of values will be between 1 and 1000 inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|