From 85bb3ead69b27c9785eed24d9084f6a15ec21848 Mon Sep 17 00:00:00 2001 From: Jesper Kuutti Date: Tue, 4 Sep 2018 23:30:58 +0300 Subject: [PATCH] =?UTF-8?q?Testit=20menev=C3=A4t=20l=C3=A4pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koodi.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/koodi.rb b/koodi.rb index 932f2b3..11b5ad9 100644 --- a/koodi.rb +++ b/koodi.rb @@ -1 +1,9 @@ -# kirjoita koodi tänne +def puuttuva(t) + (t.length() +1).times do |i| + if not t.include? i + return i + end + end +end + +puts puuttuva([1,2,4,0])