All Questions
Tagged with dynamic-programmingcombinatorics
2 questions
7votes
3answers
9kviews
Number of strings containing a specific substring
I've seen numerous questions (and answers) concerning the number of binary strings (e.g "10010" containing some binary substring (e.g "00"). I'd like to know if there is a way to generalize this: ...
0votes
1answer
746views
Number of sequences when no adjacent items can be the same
I came across this one problem, There is a particular sequence only uses the numbers 1, 2, 3, 4 and no two adjacent numbers are the same. Write a program that given n1 1s, n2 2s, n3 3s, n4 4s will ...