• + 4 comments

    The test cases are wrong, at least, if you use the formal definition of Kaprekar numbers. According to Test case 6, which I failed, 5292 is not a Kaprekar number. But it is, according to http://oeis.org/A006886

    But I notice that the problem formulation is not actually about Kaprekar numbers: if the left side must have d digits in it, and the right have either d or d-1, this excludes Kaprekar numbers where the "split" is not "in the middle or kind-of in the middle", which this problem is actually about.

    Please correct either the problem formulation to reflect that we do not actually seek all Kaprekar numbers or the expected output of some test cases such that the actual definition is used.