Dynamic Programing

This is a exam question which I had no idea how to solve, given a set S = {2, 9, 14} and integer N=22914. The integer N can be obtained by creating a string by concatenating the digits 2,2,9,14. Integer N = 16 can be obtained by the string “2+14”. Integer N = 48 can be obtain using the string “8+2*9+22”. Write c++ code using dynamic programming to output the number of digits used from set if a solution exists otherwise return -1 for example n = 1, returns -1, n = 22914 returns 4.
Price $15.00

Answers to advanced questions are only visible to original posters.

We have mentors from

Contact support