Created
October 8, 2016 19:39
-
-
Save bakkiraju/6ca3e8675bfe26facf0aae0b419eb210 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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