From 6c7e002f77768db98f4eeb2d98aa2c2b7d7418b1 Mon Sep 17 00:00:00 2001 From: AnteronGitHub Date: Fri, 22 Jan 2016 14:11:58 +0200 Subject: [PATCH] =?UTF-8?q?koodi.rb=20p=C3=A4ivitetty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- koodi.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/koodi.rb b/koodi.rb index 932f2b3..135a3b5 100644 --- a/koodi.rb +++ b/koodi.rb @@ -1 +1,13 @@ # kirjoita koodi tänne +def puuttuva(a) + luvut = [] + for i in 0..a.length + luvut << i + end + + a.length.times do |i| + luvut.delete(a[i]) + end + + luvut[0] +end \ No newline at end of file