Statistics

Problem Statement for "SpecialNum"

Problem Statement

PROBLEM STATEMENT
A number is considered special when the product of its digits is equal to the
sum of its digits.  22 is a special number because 2+2 = 2*2.

You will be given two numbers as inputs and must determine the number of
special numbers between the two given inputs, inclusive.

DEFINITION
Class: SpecialNum
Parameters: int, int
Returns: int
Method signature (be sure your method is public):  int count(int min, int max);

TopCoder will ensure the validity of the inputs.  Inputs are valid if all of
the following criteria are met:
- min is less than or equal to max
- min and max are both in the range 1 to 999,999,999 inclusive

EXAMPLES
1. min = 1, max = 5
all the numbers in this range are special, so the method returns 5.

2. min = 15, max = 98
only 22 is special in this range, so the method returns 1.

3. min = 200, max = 300
both 213 and 231 are special, so the method returns 2.

4. min = 82111111, max = 82111111
returns 1

5. min = 1, max = 1000000
returns 98

Definition

Class:
SpecialNum
Method:
count
Parameters:
int, int
Returns:
int
Method signature:
int count(int param0, int param1)
(be sure your method is public)

Constraints

    Examples


      This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
      This problem was used for: