Back to General discussions forum
Can you explain how to recognize which digit swap should be made? My code is correct and i find the correct digits. Thanks
Hi Stefan! I'm not sure I understand your trouble, but you can try to swap each pair starting from left and stop when you find which results in correct checksum.
6858060553208574 2127900796513965 6732143959375747
6858060553208574 2129700796513965 6372143959375747
as you can see i find the correct number in '?' place, but in some numbers it swaps some digits. why this is happening in solution? what am i missing? thanks
Could you post all three things, please:
Of course feel free to cut unnecessary things out.
> but in some numbers it swaps some digits
I thought there are two type of "errors" in the input data:
Each number will have only one type of error, of course - either ?
or swap. So you need
to replace question mark with digit, or find which digits to swap (trying every pair
starting from the left).
Did this make sense?