Skip to content

Commit

Permalink
Create ranges-to-array(easy).md
Browse files Browse the repository at this point in the history
  • Loading branch information
iMagesh authored May 2, 2022
1 parent 4fc4be5 commit 07bbd66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ruby/ranges-to-array(easy).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Implement the utility function ranges_to_a that takes a variable number of ranges and concatenates all values within each range into a single array.

For example, ranges_to_a((3..4),(1..3))​ should return [3, 4, 1, 2, 3].

```ruby
def ranges_to_a(*ranges)
return nil
end

puts ranges_to_a((3..4),(1..3))
```

0 comments on commit 07bbd66

Please sign in to comment.