Sha256: dfd08b2dcb015f035144cff9f5f7787cfad0a3b89b24ad9fa19d918da83aee67
Contents?: true
Size: 152 Bytes
Versions: 1
Compression:
Stored size: 152 Bytes
Contents
def fibonacci(num) arr = [1, 1] loop do arr << (arr[(arr.length - 2)] + arr.last) break if arr.length > num end return arr.take(num) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fibonacci-generator-ah-0.1.0 | lib/fibonacci-generator-ah.rb |