Back to General discussions forum
For the following entry 2931295293196099
the judge finds it wrong and proposes the exchange of the digits 14 and 15, but... both sums are equal -> 80 Why is the original entry not considered valid?
original 2931295293196099 seems to be OK 9+(92-9)+0+(62-9)+9+(12)+3+(92-9)+2+(52-9)+9+ (22)+1+(32)+9+(22) = 80
solution given by the judge 2931295293196909 interchanging those two digits does not alter the sum at all 9+(02)+9+(62-9)+9+(12)+3+(92-9)+2+(52-9)+9+(2 *2)+1+(32)+9+(2*2) = 80
Sorry, I answer myself. Rereading the statement
I deduce that it starts from the idea that there cannot be any entry that is correct. They all either have swapped digits, or are missing one
Hello! We managed to solve the problem? I also have this problem, that based on the algorithm, the card number is good, but because it does not match the solution, it is not accepted.
Hi! Can you please remind me what exactly problem? Could you perhaps share example of the value in input, your answer and expected answer?
Main things to note are - input entry is not initially correct and for swap you should return the leftmost possible pair.