日期:2014-05-20  浏览次数:20774 次

大家帮忙看看这程序题什么意思,英文不好,看不懂!
2. MultiplesWithLimit
Problem Statement
Your task is to find the minimal positive integer x such that:                                                       
1. x is an integer multiple of N.
2. The decimal representation of x doesn't contain any forbidden digits.
You will be given the forbidden digits as a int[] forbiddenDigits.                                                   
If there is no solution, you should return the String "IMPOSSIBLE" (quotes for clarity).                             
If there is a solution and its number of digits is strictly less than 9, you should return a String
containing the integer x in base 10, with no leading zeros.
Otherwise, you should return a String of the form "abc...def(g digits)" (quotes for clarity). In the
return value, abc are the first three digits of the smallest valid integer x, def are its last three
digits, and g is the number of digits in x (a base-10 integer with no leading zeros).
Definition
Class: MultiplesWithLimit
Method: minMultiples
Parameters: int, int[]
Returns: String
Method signature: String minMultiples(int N, int[] forbiddenDigits)
(be sure your method is public)
Constraints
- N will be between 1 and 10000, inclusive.
- forbiddenDigits will contain between 0 and 10 elements, inclusive.                                        
- Each element of forbiddenDigits will be between 0 and 9, inclusive.                                       
- The elements of forbiddenDigits will be pairwise distinct.                                                
Examples           
0) 8
{2,3,4,5,6,7,8,9}
Returns: "1000"
The smallest positive multiple of 8 that only contains digits 0 and 1 is 1000.