As I said in my reply, it's when more than two switches are closed at once that you must have the diodes. Suppose switches A1 and B1 are closed. Then lines A and B are shorted together. So when you discover that driving A causes line 5 to be detected (as well as lines 1 and 2), you don't know whether it is A5 or B5 (or both) that is closed.