Problem Statement |
| | Return the number of positive integers that are multiples of each number in divisors and divisors of each number in multiples. |
| |
Definition |
| | | Class: | FactoVisors | | Method: | getNum | | Parameters: | int[], int[] | | Returns: | int | | Method signature: | int getNum(int[] divisors, int[] multiples) | | (be sure your method is public) |
|
| |
|
| |
Constraints |
| - | divisors and multiples will each contain between 1 and 50 elements, inclusive. |
| - | Each element of divisors and multiples will be between 1 and 10^9, inclusive. |
| |
Examples |
| 0) | |
| | | Returns: 9 | | The working integers are 1, 2, 4, 5, 10, 20, 25, 50, and 100. |
|
|
| 1) | |
| | | Returns: 1 | | 18 is the only integer that works. |
|
|
| 2) | |
| | |
| 3) | |
| | |
| 4) | |
| | {1000,10000,100000} | {1000000000} |
| Returns: 25 | |
|