class Array
# Flattens only an array of integers with varying dimensions
def flatty!
self.to_s.tr('[]','').split(',').map(&:to_i)
end
def flatty_test
a1 = [[1, 2, [3]], 4]
a2 = [1, [2, 3, 4], [[[5, [6]]]]]
puts a1.flatty!.to_s
puts a2.flatty!.to_s
end
end