finding array element maximum lengths