From 20d5ea3b6d419bd3b9fc62f07c3863607ff1c167 Mon Sep 17 00:00:00 2001 From: Vitor Oliveira Date: Sat, 10 Apr 2021 10:49:41 -0700 Subject: [PATCH] Update next_greater_element.rb --- data_structures/arrays/next_greater_element.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structures/arrays/next_greater_element.rb b/data_structures/arrays/next_greater_element.rb index ffe957e..92b3344 100644 --- a/data_structures/arrays/next_greater_element.rb +++ b/data_structures/arrays/next_greater_element.rb @@ -29,8 +29,8 @@ # Complexity Analysis # -# Time complexity : O(m*n). The complete nums1 array (of size n) needs to be scanned for all the m elements of nums2 in the worst case. -# Space complexity : O(1). No additional space since we're swapping elements in nums1 and returning the input array. +# Time complexity: O(m*n). The complete nums1 array (of size n) needs to be scanned for all the m elements of nums2 in the worst case. +# Space complexity: O(1). No additional space since we're swapping elements in nums1 and returning the input array. # @param {Integer[]} nums1 # @param {Integer[]} nums2