```diff - if len(s) > 2 and s[0] == '[' and s[-1] == ']': + if s.startswith('[') and s.endswith(']'): ```