Given an integer N, the task is to find the value of the expression ( N1 * (N – 1)2 * … * 1N) %… Read More

# Tag Archives: factorial

Given three positive integers, L, R, K and an array arr[] consisting of N positive integers, the task is to count the number of ways… Read More

Given an integer N, the task is to count the numbers less than or equal to N such that each number contains at least one… Read More

A factorial is positive integer n, and denoted by n!. Then the product of all positive integers less than or equal to n. For example:… Read More

Given N distinct objects, the task is to find the number of distinct arrangements of N objects if all clockwise arrangements are considered the same.… Read More

Given an integer N, the task is to count the total number of unimodal and non-unimodal permutations of integers [1, N] possible. A unimodal permutation… Read More

Given an array, arr[] of size N consisting of elements from the range [1, N], that represents the order, in which the elements are inserted… Read More

Given two strings, str1 of length N and str2 of length M of distinct characters, the task is to count the number of ways to… Read More

Given an integer N where 1 ≤ N ≤ 105, the task is to find whether (N-1)! % N = N – 1 or not.Examples:… Read More

Given a number N, print all the Strong Numbers less than or equal to N. Strong number is a special number whose sum of the… Read More

Given two number X and N, the task is to find the last digit of X raised to last digit of N factorial, i.e. .… Read More

Given a natural number N, the task is to find the Nth compositorial number. Compositorial of a number refers to the product of all the… Read More

Given an integer N, the task is to find the last two digits of factorial of a number. Examples: Input: N = 7 Output: 40… Read More

Given a very large number N, the task is to find the factorial of the number using Log. Factorial of a non-negative integer is the… Read More

Given number of orders, find the number of valid arrangements of orders where delivery of ith order is always after the pickup of ith order.Examples:… Read More