Skip to content

Instantly share code, notes, and snippets.

View arbox's full-sized avatar
🏠
Working from home

Andrei Beliankou arbox

🏠
Working from home
View GitHub Profile
require 'benchmark'
Benchmark.bmbm do |r|
NUMBER = 10_000_000
words = %w[apple banana carrot durian pear orange]
r.report('zip') do
NUMBER.times do
words[0..-2].zip(words[1..-1]).all? do |left, right|
left <= right
end