Problem Solving: any hints how we can solve?
Consider a boat of length x which has 2 * x spots. let's think that we need to fill it up with men and women for transport

However we have two restrictions in doing so

1. No two men on the same side of the boat can be adjacent.
2. No two men on different sides of the boat can be exactly opposite to each other i.e. they cant overlook each other.
There are no restrictions on women's placement and each spot must be filled with either of them.

Given the length of the boat, find the total number of ways we can fill it up.
Examples:

Input : 2
Output : 7

Input : 1
Output : 3
Comments (1)