The question asks the number of possible binary arrays (lets call it nums) of length n that meets the following conditions:
For example:
n = 3, we have 000, 010, a total of 2 possible arrays
n = 4, we have 0010, 0100, 0110, a total of 3 possible arraysShould be solvable with DP but only got 10 minutes left for this question, didn't come up with one.
Update:
This is a very similar question to LC - 552. Student Attendance Record II.