We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7400c5e commit 6b2a9ceCopy full SHA for 6b2a9ce
_codewars.rb
@@ -1,3 +1,26 @@
1
+# codewars kata: which are in?
2
+# http://www.codewars.com/kata/which-are-in/train/ruby
3
+
4
+def in_array(array1, array2)
5
+ string = array2.join(' ')
6
+ array1.select { |substring| string.include? substring }.sort!
7
+end
8
9
10
+# codewars kata: deodorant evaporator
11
+# http://www.codewars.com/kata/deodorant-evaporator/train/ruby
12
13
+def evaporator(content, evap_per_day, threshold)
14
+ days = 0
15
+ threshold_amount = threshold.fdiv(100) * content
16
+ until content < threshold_amount do
17
+ content -= evap_per_day.fdiv(100) * content
18
+ days += 1
19
+ end
20
+ days
21
22
23
24
# codewars kata: operations with sets
25
# http://www.codewars.com/kata/operations-with-sets/train/ruby
26
0 commit comments