Skip to content

Bug Report for is-palindrome #6002

Description

@Shagdovala159

Bug Report for https://neetcode.io/problems/is-palindrome

based on my submissions, it should be wrong right? i don't add case for number but its still accepted

class Solution:
    def isPalindrome(self, s: str) -> bool:
        left = 0
        right = len(s) - 1
        lc_s = s.lower()

        while left < right:
            if ord(lc_s[left]) < 97 or ord(lc_s[left]) > 122:
                left += 1
            elif ord(lc_s[right]) < 97 or ord(lc_s[right]) > 122:
                right -= 1
            elif ord(lc_s[left]) != ord(lc_s[right]):
                return False
            else:
                left += 1
                right -= 1

        return True

I think the neetcode team need to add some usecase for that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions