Implement subset_sub_dynamic_programming/js