**From New Scientist #2679, 25th October 2008**

Joe was furious when he forgot one of his bank account numbers. He remembered that it had all the digits 0 to 9 in some order, so he tried the following four sets without success:

9462157830
8604391257
1640297853
6824319075

When Joe finally remembered his account number, he realised that in each set just four of the digits were in their correct position and that, if one knew that, it was possible to work out his account number.

What was it?

[enigma1517]

### Like this:

Like Loading...

*Related*

While I was thinking of a more elegant way to approach this puzzle I wrote this simple Python program to brute force it, and was surprised to find that it ran in 2.3s (using PyPy) – well before I’d written a different program to solve it.

Solution:The account number is 9624317850.Here is a more efficient Python program to solve the puzzle. It runs in 35ms.

However this provides is a good example of programmer efficiency. If you are only going to run the program once, then clearly the above code, which took a couple of minutes to write and runs a few seconds, is much more time efficient than time it took to come up with the following code.

If however you want to re-use the code to solve thousands of similar problems a day, clearly this second program is going to make up for the development time on the first day.