Algorithm practice for Ruby and Javascript.