My own version of The Technical Interview Cheat Sheet
##Table of Contents
# Extracting multiples of 3 | |
multiples_of_3 = Proc.new do |n| | |
n % 3 == 0 | |
end | |
(1..100).to_a.select(&multiples_of_3) | |
# Round down method | |
floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911] | |
round_down = Proc.new { |n| n.floor } |
My own version of The Technical Interview Cheat Sheet
##Table of Contents