This is a periodic problem.
Because its rules are: black, black, white, black, black, white, black, white ... every six is 1 group.
20 12÷6=335.....2
You can think of it this way. You have counted the last color of 335 groups, white, but you counted it again, so it is black.
There are 3 blacks in 1 group and 335×3= 1005 in 335 group.
But the other two are also black.
So there is: 1005+2= 1007.
So choose D.
I wish you progress in your study and hope to adopt it. Thank you! ! O(∩_∩)O~