In my first developper job interview I was asked to code the & method of Ruby a method which gives the intersection of two arrays.
Given [1, 1, 1, 4, 5] and [1, 1, 4, 7], intersection must be [1, 1, 4].
Finished in 0.00108 seconds (files took 0.06966 seconds to load)
Finished in 0.00111 seconds (files took 0.06347 seconds to load)
with some improvement (af2f9f5ee7bd85124bca9498a405f423e1fa97ea)
Finished in 0.00108 seconds (files took 0.06432 seconds to load)
Finished in 0.00111 seconds (files took 0.06651 seconds to load)