| ||A string of letters A, B, C is forbidden if there are three consecutive letters from which one is A, one is B, and one is C. For example, BAACAACCBAAA is forbidden, while AABBCCAABB is not.|
Your task is to calculate how many such strings of length n are not forbidden.
|Method signature:||long countNotForbidden(int n)|
|(be sure your method is public)|
|-||n will be between 1 and 30, inclusive.|
|All 9 strings of length 2 are not forbidden.
|There are 27 strings of length 3. Of these, 6 contain one occurrence of each letter. Those 6 strings are forbidden, so you should return 21.