Because this way you only read the data in once and don't need to make any changes to it which allows you to pick different data structures.
I read the article twice but had the exact same reaction on both occasions that somehow we used a "big" bat to kill a small ant when some easier solutions would have sufficed.
Though, it's looks very likely that I might be missing something really minuscule.