Skip to content

Instantly share code, notes, and snippets.

Carson Cole carsoncole

Block or report user

Report or block carsoncole

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@carsoncole
carsoncole / array.rb
Last active Apr 14, 2016
Ruby method that flattens arbitrary number of nested arrays of integers.
View array.rb
def self.flatten(array)
array.to_s.gsub(/[\[\]]/,'').split(/\s*,\s*/).map { |x| x.to_i }
end
You can’t perform that action at this time.