Big O Notation & Complexity in Ruby