From 7b6edea968639cd08f06ff3eb2c002c745a77aab Mon Sep 17 00:00:00 2001 From: Jessica Kwok Date: Tue, 23 Mar 2021 08:05:54 -0700 Subject: [PATCH] Fix time complexity --- data_structures/arrays/single_number.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/arrays/single_number.rb b/data_structures/arrays/single_number.rb index 75ed4fa..163b7b1 100644 --- a/data_structures/arrays/single_number.rb +++ b/data_structures/arrays/single_number.rb @@ -42,7 +42,7 @@ puts(single_number(nums)) # # Approach 2: Use Ruby .count() # -# Time Complexity: O(1) +# Time Complexity: O(n^2) # def single_number(nums) nums.find do |num|