Hi guys. Im a student and i have a problem in finding the right procedure to solve my problem. Giving a set of numbers that will find their combination for a given value. For example 1st digit will be the size and the 2nd digit will be the qty.:

Size qty

10 10

20 10

30 10

40 10

50 10

60 10

70 10

80 10

90 10

100 10

the problem will be, I’ll find the 1 to 5 combinations to have a sum of 100:

the answers will be like the following:

100 10

90+10 10

80+20 10

70+30 10

40+60 10

50+50 5

the answers is only 1 and 2 combinations. I would like to create a procedure that will compute up to 5 combinations and will check the qty is still available for combining into another size. the problem is my function becomes very slow when im trying to manipulate it using string handling functions. Any input that will enlighten my mind will be a great help. Thanks in advance.