Update next_greater_element.rb

This commit is contained in:
Vitor Oliveira 2021-04-10 10:49:41 -07:00 committed by GitHub
parent 4d9d7ca1cd
commit 20d5ea3b6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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