Create description.md
This commit is contained in:
parent
130175d474
commit
480673b42a
1 changed files with 32 additions and 0 deletions
32
library/description.md
Normal file
32
library/description.md
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
Your library teacher has a 2-row bookshelf that can contain N books in each row. She wants to know the number of ways that she can fill the bookshelf with red-colored books and blue-colored books such that no 2 red-colored books are adjacent to each other (horizontally or vertically).
|
||||||
|
|
||||||
|
Input: the integer, N
|
||||||
|
Output: the number of ways you can place red-colored books and blue-colored books onto the bookshelf
|
||||||
|
|
||||||
|
Ex: N=3
|
||||||
|
|
||||||
|
|
||||||
|
Input: 3
|
||||||
|
|
||||||
|
BB
|
||||||
|
BB
|
||||||
|
|
||||||
|
BB
|
||||||
|
BR
|
||||||
|
|
||||||
|
BR
|
||||||
|
BB
|
||||||
|
|
||||||
|
RB
|
||||||
|
BB
|
||||||
|
|
||||||
|
BB
|
||||||
|
RB
|
||||||
|
|
||||||
|
RB
|
||||||
|
BR
|
||||||
|
|
||||||
|
BR
|
||||||
|
RB
|
||||||
|
|
||||||
|
Output: 6
|
Loading…
Reference in a new issue