Problem Statement |
| A positive integer is called a mega cool number if its digits form an arithmetic progression. An arithmetic progression is a sequence of numbers in which the difference between any two consecutive numbers is the same. Return the number of mega cool numbers between 1 and N, inclusive.
|
|
Definition |
| Class: | MegaCoolNumbersEasy | Method: | count | Parameters: | int | Returns: | int | Method signature: | int count(int N) | (be sure your method is public) |
|
|
|
|
Constraints |
- | N will be between 1 and 1,000, inclusive. |
|
Examples |
0) | |
| | Returns: 1 | The only mega cool number not greater than 1 is 1. |
|
|
1) | |
| | Returns: 99 | All numbers between 1 and 99 are mega cool. |
|
|
2) | |
| |