Permalink
Browse files

delete redundant array_concat

  • Loading branch information...
1 parent 0fec2d7 commit 96790b023c553b1f44f83fdd3afa61e92464997f @maryrosecook committed Dec 24, 2012
Showing with 0 additions and 9 deletions.
  1. +0 −9 array_concat.rb
View
@@ -1,9 +0,0 @@
-a = ["a", ["b", "c", "d"], "e", ["f"], ["g", ["h", "i"], "j", "k"], "k", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
-
-def concat(a)
- return "" if a.first.nil?
- return concat(a.first) + concat(a[1..-1]) if a.first.kind_of?(Array)
- a.first + concat(a[1..-1])
-end
-
-puts concat(a)

0 comments on commit 96790b0

Please sign in to comment.