It seems like there should be a leetcode problem like this, but I can't seem to find it.
Question: Can an array be formed by concatenating smaller arrays, no repeats allowed?
Example:
array: [1,2,5,3]
sub_arrays = [[1,2], [3], [5]]
Answer: True
array: [1,6,4,2,2]
sub_arrays: [[1,5,5], [4,2], [2], [6]]
Answer: FalseI'm thinking this is probably something greedy or dynamic programming?