Get Time

   Problem Statement  

 Problem Statement for InterestingNumber

Problem Statement

    Fox Ciel thinks that the number 41312432 is interesting. This is because of the following property: There is exactly 1 digit between the two 1s, there are exactly 2 digits between the two 2s, and so on.

Formally, Ciel thinks that a number X is interesting if the following property is satisfied: For each D between 0 and 9, inclusive, X either does not contain the digit D at all, or it contains exactly two digits D, and there are precisely D other digits between them.

You are given a String x that contains the digits of a positive integer. Return "Interesting" if that integer is interesting, otherwise return "Not interesting".


Method signature:String isInteresting(String x)
(be sure your method is public)


-x will correspond to an integer between 1 and 1,000,000,000, inclusive.
-x will not start with a '0'.


Returns: "Interesting"
There are 0 digits between the two 0s, and 2 digits between the two 2s, so this is an interesting number.
Returns: "Not interesting"
There should be 1 digit between the two 1s, but there are 2 digits between them. Hence, this number is not interesting.
Returns: "Interesting"
This is the number in the statement.
Returns: "Not interesting"
There is only one digit 6 in this number, so it's not interesting.
Returns: "Interesting"
Returns: "Not interesting"
This number contains the digit 1 three times.

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)2010, TopCoder, Inc. All rights reserved.

This problem was used for:
       Single Round Match 611 Round 1 - Division II, Level One