Skip to content

Tag Archives: factorial

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. An 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. .Examples:   Input:… 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 Explanation: 7! =… 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 the number of orders, find the number of valid arrangements of orders where delivery of ith order is always after the pickup of ith… Read More
Given a number n, we need to find the last digit in factorial n. Input : n = 4Output : 44! = 4 * 3… Read More
Given a Linked list of N integers, the task is to find the sum of factorials of each prime element in the list.Examples:   Input: L1… Read More
Given an integer n, write a Go program to count the number of trailing zeros in the factorial of n. Examples: Input : 7 Output… Read More
Given a number N (≤ 1018), the task is to find the next factorial number greater than N.Examples:   Input: N = 24 Output: 120 Explanation: As 4! =… Read More

Start Your Coding Journey Now!