First loop to identify index of 4. then second loop to create a new
int[].