Lets say that I have a JSON file as such:
{
"item1":{"time":"00:18:21"},
"item2":{"time":"00:22:22"},
"item3":{"time":"00:02:11"},
"item4":{"time":"01:34:32"}
}
How would I go about finding all possible values of item combination time sums that exist between lets say 00:03:04 to 00:25:55
without finding every single permutation combination that exists and adding them for that set? ex item 1 and item 3 would be found in that time constraint where their times add together to 00:20:32
. I have tried to use permutations, but you run into certain drawbacks with more objects. If I go up to 7 objects, it clearly takes me over 13,000 iterations of adding time values together and checking for range constraints. What can I do to simplify the algorithm?
Edit: (You guys requested some background information) I'm trying to make an application that sorts through a collection of videos with length in hh:mm:ss format and generate a playlist with a given time length.