Old Top Coder riddle: Making a number by inserting +
问题 I am thinking about this topcoder problem. Given a string of digits, find the minimum number of additions required for the string to equal some target number. Each addition is the equivalent of inserting a plus sign somewhere into the string of digits. After all plus signs are inserted, evaluate the sum as usual. For example, consider "303" and a target sum of 6. The best strategy is "3+03". I would solve it with brute force as follows: for each i in 0 to 9 // i -- number of plus signs to