I am trying to find an algorithm that solves this question but I am struggling.
Question: There are N subsets each has a cost of 1. (ex: 123, 145, 23, 12) We are trying to chose the minimum amount of subsets in order to have all digits of the subsets.
EX1: If the input 12 24 35 12345 13 14 15 23 25, the answer is 1 because we will only chose "12345".
CONSTRAINTS: The digits of the subset can be from 1 to 9 (zero is excluded), the number of subsets is always 9.