A Pandigital Number is number which makes the use of all digits 1 to 9 exactly once. We are given a number, we need to find if there are two numbers whose multiplication is given number and given three numbers together are pandigital.
Input : 7254 Output : Yes 39 * 186 = 7254. We can notice that the three numbers 39, 186 and 7254 together have all digits from 1 to 9. Input : 6952 Output : Yes
The idea is to consider all pairs that multiply to given number. For every pair, create a string containing three numbers (given number and current pair). We sort the created string and check if sorted string is equal to “123456789”.
- Pandigital number in a given base
- Maximum product from array such that frequency sum of all repeating elements in product is less than or equal to 2 * k
- Program for dot product and cross product of two vectors
- Product of first N factorials
- Sum of product of x and y such that floor(n/x) = y
- Cartesian Product of Two Sets
- Sum of product of r and rth Binomial Coefficient (r * nCr)
- Maximum GCD of N integers with given product
- Product of N with its largest odd digit
- Maximum GCD from Given Product of Unknowns
- Longest sub-array whose product is 0
- Digit - Product - Sequence
- Number of subarrays having product less than K
- Check whether product of 'n' numbers is even or odd
- Product of factors of number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.