add space complexity

This commit is contained in:
Vitor Oliveira 2021-07-02 12:52:55 -07:00 committed by GitHub
parent b40fe95c43
commit a0952eb7b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,8 +19,15 @@
# 1 <= s.length <= 105
# s consists of lowercase English letters.
#
# Approach 1: Two Pointers
#
# Complexity Analysis:
#
# Time Complexity: O(n)
# Space Complexity: O(1)
def almost_palindrome_checker(string)
p1 = 0
@ -57,4 +64,4 @@ puts almost_palindrome_checker('abca')
# => true
puts almost_palindrome_checker('abc')
# => false
# => false