From 6c6018d91d153cdd97aa4dfcb7d88e0dfc02573c Mon Sep 17 00:00:00 2001 From: Katrina Aganon Date: Wed, 22 Aug 2018 17:36:26 -0700 Subject: [PATCH 1/2] completed and passed all tests --- lib/array_equals.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/array_equals.rb b/lib/array_equals.rb index 58e8369..38f21a1 100644 --- a/lib/array_equals.rb +++ b/lib/array_equals.rb @@ -1,5 +1,27 @@ +require 'pry' # Determines if the two input arrays have the same count of elements # and the same integer values in the same exact order def array_equals(array1, array2) + + is_equal = false + + if array1 != nil && array2 != nil + if array1.length == array2.length + if array1.length == 0 + is_equal = true + end + array1.each_with_index do |num, i| + if num == array2[i] + is_equal = true + end + end + + end + elsif array1 == nil && array2 == nil + is_equal = true + end + + return is_equal + raise NotImplementedError end From a1fb71264dd5e81914188fb957ec52b2e74eedc4 Mon Sep 17 00:00:00 2001 From: Katrina Aganon Date: Wed, 22 Aug 2018 17:38:22 -0700 Subject: [PATCH 2/2] removed require pry --- lib/array_equals.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/array_equals.rb b/lib/array_equals.rb index 38f21a1..00fe411 100644 --- a/lib/array_equals.rb +++ b/lib/array_equals.rb @@ -1,4 +1,3 @@ -require 'pry' # Determines if the two input arrays have the same count of elements # and the same integer values in the same exact order def array_equals(array1, array2)