This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users": [{ | |
"id": 1 | |
}, { | |
"id": 2 | |
}, { | |
"id": 3 | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | People's Co-op Farmers Market | 30th and Burnside | Portland | Multnomah | Oregon | 97202 | |
---|---|---|---|---|---|---|---|
2 | Silverdale Farmers Market | 98383 | Silverdale | Kitsap | Washington | 98383 | |
3 | Dolgeville Farmer's Market | (Parking Lot) Between Main St. and Helmer Ave | Dolgeville | Herkimer | New York | 13329 | |
4 | Preston Farmers’ Market | #1 Route 164 | Preston | New London | Connecticut | ||
5 | Quincy Farmers Market | 0 Denis Ryan Parkway | Quincy | Norfolk | Massachusetts | 2169 | |
6 | Jefferson City Farmer's Market | 000 Main Street | Jefferson City | Cole | Missouri | 0 | |
7 | Petaluma Evening Farmers' Market | 1 2nd Street | Petaluma | Sonoma | California | 94952 | |
8 | Charlestown Farmers Market | 1 Austin Street, Thompson Square at Austin & Main Streets | Boston | Massachusetts | 2129 | ||
9 | Farmers Market at Christopher Newport University | 1 Avenue of the Arts | Newport News | Newport News | Virginia | 23606 | |
10 | Saratoga Farmers' Market | 1 Bayberry Drive | Ballston Sp | Saratoga | New York | 12020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Transaction | |
attr_accessor :amount, :success | |
def initialize(amount, success) | |
@amount = amount | |
@success = success | |
end | |
def success? | |
@success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method that takes two inputs (an array, a target sum) | |
# outputs an array of pairs that sum to the target sum | |
# ([1,2,3,4], 5) => [[1,4], [2,3]] | |
def sum_pairs(array, target) | |
matches = [] | |
i = 0 | |
array.each do |first| | |
i += 1 | |
array[i..-1].each do |second| |
NewerOlder