Use each_with_index.