Count of distinct permutations of length N having no similar adjacent characters | Java program to implement the above approach ; Function to print the number of permutations possible ; Driver Code
class GFG { static int countofPermutations ( int N ) { return ( int ) ( 3 * Math . pow ( 2 , N - 1 ) ) ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . print ( countofPermutations ( N ) ) ; } }