stammarama
I hereby claim:
- I am astamm78 on github.
- I am stammarama (https://keybase.io/stammarama) on keybase.
- I have a public key ASDll2TMvzigbMNY5uTRVQsf2uuqmZjPUn3dfmd0vVc7iAo
To claim this, I am signing this object:
stammarama
I hereby claim:
To claim this, I am signing this object:
<script src="zoo.js"></script> |
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
def sorter(array) | |
working = array.clone | |
self.rec_sort(working, []) | |
end | |
def rec_sort(unsorted, sorted) | |
while unsorted.length > 0 | |
value = unsorted.inject do |first, second| | |
first < second ? first : second | |
end |
# Implement a method called times_table which takes as its input an | |
# integer and prints out a times table with that number of rows. | |
# The numbers can be separated by any spaces or tabs, but each row must | |
# be on a new line. This means it's ok if the columns don't line up. | |
# For example, times_table(5) should print the following out to the screen: | |
# 1 2 3 4 5 | |
# 2 4 6 8 10 |
# Write a method mode which takes an Array of numbers as its input and returns | |
# an Array of the most frequent values. | |
# If there's only one most-frequent value, it returns a single-element Array. | |
# For example, | |
# mode([1,2,3,3]) # => [3] | |
# mode([4.5, 0, 0]) # => [0] | |
# mode([1.5, -1, 1, 1.5]) # => [1.5] |