Array exercise solved