Get max index of an array