Update split_array.rb

Fixed code based on Jordan's comments