Skip to content

Instantly share code, notes, and snippets.

@jadechip
Last active September 6, 2019 13:23
Show Gist options
  • Save jadechip/2727a301e27ab6795b92755c93d96b75 to your computer and use it in GitHub Desktop.
Save jadechip/2727a301e27ab6795b92755c93d96b75 to your computer and use it in GitHub Desktop.
Programming challanges: Is Palindrome
# O(n)
def isPalindrome(string):
left = 0
right = len(string) - 1
while left < right:
if string[left] == string[right]:
left += 1
right -= 1
else:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment