mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-13 08:01:03 +01:00
Added space complexity
This commit is contained in:
parent
07c7bd1f27
commit
d4b1efef5a
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
# Approach 1: Hash Map
|
# Approach 1: Hash Map
|
||||||
# Time Complexity: O(N)
|
# Time Complexity: O(N)
|
||||||
|
# Space Complexity: O(N)
|
||||||
|
|
||||||
def isomorphic_strings_check(s, t)
|
def isomorphic_strings_check(s, t)
|
||||||
# store character mappings
|
# store character mappings
|
||||||
|
@ -60,4 +61,4 @@ puts isomorphic_strings_check("foo", "bar")
|
||||||
# => false
|
# => false
|
||||||
|
|
||||||
puts isomorphic_strings_check("paper", "title")
|
puts isomorphic_strings_check("paper", "title")
|
||||||
# => true
|
# => true
|
||||||
|
|
Loading…
Reference in a new issue