Back to problems

Implement palindrome check and valid parentheses

Algorithm · Boston Consulting Group · Medium

Implement the two routines described below. For each one, include a docstring with a short description, the parameters and return value, and callouts covering assumptions, edge-case behavior, and time/space complexity notes. Be prepared to explain your approach and its time and space complexity. The first routine checks whether a string is a palindrome. Given s, return True exactly when the character sequence is identical read left-to-right and right-to-left. The check is…

Checking your access…