问个google面试题# JobHunting - 待字闺中
B*1
1 楼
Given an array of strings of 0s and 1s. X and Y are also given. Return the
maximum number of elements in a subset of the array elements which will X
number of zeroes and Y number of 1s when combined. For eg: if array[] = {"01
", "10", "0", "110"} X=3, Y=2
Answer should be 3 since first 3 strings when combined will give the
required number of 0s and 1s.
这题是不是要用dp啊。
maximum number of elements in a subset of the array elements which will X
number of zeroes and Y number of 1s when combined. For eg: if array[] = {"01
", "10", "0", "110"} X=3, Y=2
Answer should be 3 since first 3 strings when combined will give the
required number of 0s and 1s.
这题是不是要用dp啊。