Skip to content

Instantly share code, notes, and snippets.

@bakkiraju
Created October 8, 2016 19:39
Show Gist options
  • Select an option

  • Save bakkiraju/6ca3e8675bfe26facf0aae0b419eb210 to your computer and use it in GitHub Desktop.

Select an option

Save bakkiraju/6ca3e8675bfe26facf0aae0b419eb210 to your computer and use it in GitHub Desktop.
from collections import deque
def isPlainDrome(inDeque):
while len(inDeque) > 1:
if inDeque.pop() != inDeque.popleft():
return False
return True
print(isPlainDrome(deque("eye")))
print(isPlainDrome(deque("liril")))
print(isPlainDrome(deque("peep")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment