Skip to content

Instantly share code, notes, and snippets.

View wangzifeng's full-sized avatar

Frank Wang wangzifeng

View GitHub Profile
@wangzifeng
wangzifeng / gist:5608126
Last active December 17, 2015 12:09
rubymonk ruby primer exam recap
#Rubymonk Ruby Primer Exam Recap
#Problem 1 - Find the length of strings in an array
#Given an array containing some strings, return an array containing the length of those strings.
#Solution Option 1 map method
["Nike","adidas","New Balance"].map{ |x| x.length }
#Output