It is okay to make two passes over the input array prior to a recursive call.