Raising a flag sequence with two colors
A signal pole will hold flags stacked top to bottom: identical red flags and identical blue flags. Two stacks are the same if the color pattern from top to bottom matches.
How many distinct color patterns are possible?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
Distinct arrangements of the letters in BANANADistinct arrangements of the letters in BALLOONDistinct arrangements of the letters in MISSISSIPPILining up pennies, nickels, and dimesWill the three A's clump together?
All questions →