This file contains 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 __future__ import print_function, unicode_literals | |
def iter_palindrome(string): | |
'''Memory efficient but unelegant iterative solution. | |
Starting at each end of the string comapre characters until the center | |
is reached or iterators overlap if it's semetric | |
''' | |
print(string) | |
i = 0 | |
j = len(string) - 1 |
This file contains 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 __future__ import print_function, unicode_literals | |
bean_types = { | |
'coffee': (24, [4, 7, 10, 12]), | |
'wax': (22, [4, 7, 9, 11]), | |
'blue': (20, [4, 6, 8, 10]), | |
'chili': (18, [3, 6, 8, 9]), | |
'stink': (16, [3, 5, 7, 8]), | |
'green': (14, [3, 5, 6, 7]), | |
'soy': (12, [2, 4, 6, 7]), |
NewerOlder