Count of distinct permutations of length N having no similar adjacent characters | C ++ Program to implement the above approach ; Function to print the number of permutations possible ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countofPermutations ( int N ) { return int ( 3 * pow ( 2 , N - 1 ) ) ; } int main ( ) { int N = 5 ; cout << countofPermutations ( N ) ; return 0 ; }