So I would not bother with a scheme which has to go twice through your list in order to build-up a navigation panel. It is a waste of cycles and memory. Just provide a navigation panel for all of "Pa", "Pe", "Pi", "Po", "Pu". It may be there is no item starting with "Po", but still include the anchor for "Po" where it should have been if there was a word with "Po". Perhaps there is a word starting with "Pr" and then your link is still quite close to the mark!
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James