Skip to content

Commit a0952eb

Browse files
authored
add space complexity
1 parent b40fe95 commit a0952eb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

data_structures/arrays/strings/almost_palindrome_checker.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@
1919
# 1 <= s.length <= 105
2020
# s consists of lowercase English letters.
2121

22+
#
2223
# Approach 1: Two Pointers
24+
#
25+
26+
# Complexity Analysis:
27+
#
2328
# Time Complexity: O(n)
29+
# Space Complexity: O(1)
30+
2431

2532
def almost_palindrome_checker(string)
2633
p1 = 0
@@ -57,4 +64,4 @@ def palindrome_checker(array, p1, p2)
5764
# => true
5865

5966
puts almost_palindrome_checker('abc')
60-
# => false
67+
# => false

0 commit comments

Comments
 (0)