From f95b07a86645cb6700ba82feaec341dc3d17901e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiia=20Bj=C3=B6rk?= Date: Thu, 19 Jan 2017 19:41:18 +0200 Subject: [PATCH] =?UTF-8?q?teht=C3=A4v=C3=A4=205=20palautus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koodi.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/koodi.rb b/koodi.rb index 932f2b3..caeb492 100644 --- a/koodi.rb +++ b/koodi.rb @@ -1 +1,9 @@ # kirjoita koodi tänne + def puuttuva(taulukko) + return taulukko.size.times do |i| + return i if taulukko.include?(i)==false + end +end + +tau = [1,2,3,4,6,0] +puuttuva(tau)