sorted_arrays without inject