Let's say I have a set of numbers '0', '1', '2', ..., '9'. I want to find all numbers that contain only one of the numbers in my set.
The problem is this: before I run my program, I do not know how many numbers and which numbers my set will include. (For example, a set may include the numbers "1", "3", and "14".)
I searched the Internet and came across the term โdynamic programmingโ, which, apparently, can use something to solve problems like mine, but I did not understand the examples.
Can someone give me a hint on how to solve this problem (maybe with dynamic programming)?
EDIT: When a dial-up includes numbers like "14", different dial-up numbers, of course, should be separated in some way, for example. when the set includes the numbers โ1โ, โ3โ and โ14โ, the combinations can be approximately 1-3-14 or 3-14-1 (= individual numbers separated by โ- '").
EDIT 2: One of the problems, which seems somewhat similar, is described here : one of the solutions uses dynamic programming.
java c algorithm permutation
alan
source share