problem_24.java
private static int calculatePermutations(int n) {
    if(n > 0)  return IntStream.rangeClosed(1, n)
                          .reduce(1, (x,y) -> x * y);
    else  return 1;
  }
//Method calculates the total number of permutations (n!) for n digits
Method calculates the total number of permutations (n!) for n digits
Method calculates the total number of permutations ( n! ) for n digits
private static int calculatePermutations(int n) {
    if(n > 0)  return IntStream.rangeClosed(1, n)
                          .reduce(1, (x,y) -> x * y);
    else  return 1;
  }
private static int calculatePermutations ( int n ) { if ( n > 0 ) return IntStream . rangeClosed ( 1 , n ) . reduce ( 1 , ( x , y ) -> x * y ) ; else return 1 ; }
Method calculates the total number of permutations (n!)
Method calculates the total number of permutations ( n! )