def nflatten(depth, result = ) return if depth <= 0 self.inject() { |result, item| result << item << nflatten(depth-1, item); result } end
def nflatten(depth, result = ) return if depth <= 0 self.inject() { |result, item| result << item << nflatten(depth-1, item); result } end