forked from rezn5447/Coding-Practice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6-19.rb
More file actions
40 lines (26 loc) · 926 Bytes
/
6-19.rb
File metadata and controls
40 lines (26 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ary = [1,2,3,4,6,7,5,4,3,3]
array2 = ["hanging",'with','friends','is','super','fun']
# TODO: Return the odd numbers from a list of integers.
# Use #select.
def odd_integers(array)
end
# TODO: Return the first number from an Array that is less than a particular number - 'limit.'
# Use #find.
def first_under(array, limit)
end
# TODO: Take an Array of Strings and return a new Array with an exclamation point appended to each String.
# Use #map.
def add_bang(array)
end
# TODO: Calculate the sum of an Array of numbers.
# Use #reduce.
def sum(array)
end
# TODO: Reorganize an Array of the elements into groups of 3, and then sort each group alphabetically.
# Use #each_slice in combination with other enumerable methods.
def sorted_triples(array)
end
# TODO: Returns an array of elements at indices 1, 3, 5, 7, etc.
# Use #each_with_index.
def odd_indexed_elements(array)
end