aboutsummaryrefslogtreecommitdiff
path: root/challenge-243/deadmarshal/ruby/ch2.rb
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-243/deadmarshal/ruby/ch2.rb')
-rw-r--r--challenge-243/deadmarshal/ruby/ch2.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-243/deadmarshal/ruby/ch2.rb b/challenge-243/deadmarshal/ruby/ch2.rb
new file mode 100644
index 0000000000..8f6fd403ef
--- /dev/null
+++ b/challenge-243/deadmarshal/ruby/ch2.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+
+def floor_sum(arr)
+ sum = 0
+ (0...arr.length).each do |i|
+ (0...arr.length).each do |j|
+ sum += (arr[i] / arr[j])
+ end
+ end
+ return sum
+end
+
+p floor_sum([2,5,9])
+p floor_sum([7,7,7,7,7,7,7])
+