The least common multiple (lcm) of a set of positive integers is the smallest
integer that is divisible by each member of the set. It is frequently desirable
to have a collection of numbers whose lcm is large.
We want to manufacture parts in a greater variety of sizes -- specifically
our goal is to offer sizes whose lcm is greater than or equal
to targetLcm. But every new size s that we manufacture costs us s
dollars to tool up to produce.
The int[] sizes contains all the sizes we are currently producing. The String targetLcm
represents an integer with no leading zeroes. Return the minimum cost of offering additional
sizes that will let us achieve our goal.
|