ruby version two sum