Check Valid Palindrome

words = [‘a’, ‘b’, ‘c’, ‘b’, ‘a’]

While len(words) > 1:

— — — — if words.pop(0) !=words.pop():

— — — — — — — — return False

Using Deque, the code can optimize the performance in speed. Deques is BigO(n)

def isPalindrome(self, s: str): -> bool:

— — — — strs: Deque = collections.deque()

— — — — for char in s:

— — — — —if char.isalum():

— — — — — — —strs.append(char.lower())

while len(strs) > 1:

— — — — if strs.popleft() !=strs.pop():

— — — — — — return False

return True

Slicing이 가장 속도가 빠르다.

--

--

Pros:

  • Dependency Management
  • Basic Constraint Support
  • Useful Plugins

Cons:

  • Complex configuration
  • High-cost learning

Maven runs the phase sequentially: compile:compile → surefire:test → jar:jar

If you want to run only want to run the specific goal, “mvn surefire:test”

--

--

Devedunkey

Education is key to success why developers are desperately learning every day.