14
hezhe88
1 6 15
904/ 945
Last seen 7 years ago
Member for 8 years, 7 months, 11 days
Difficulty Normal
Best reviews / Newest reviews
intersection-Cjkjvfnby
Great to know that set.intersection() can accept any iterable. Thank you! More
First-Eldin
Nice solution. But you might make it a couple lines shorter: put safe_pawn.append(pawn) directly under if gaurdy + gaurdx in pawns. So you don't need the variable safe anymore. Also, keeping the safe pawns in a list seems to incur redundant memory usage. Keep a int variable count and += 1 when safe More
First-frach
Nice use of zfill to avoid mod and divide. More
Second-hezhe88
Stolen from: http://www.checkio.org/mission/three-words/publications/LLluma/python-3/first/ More
First-LLluma
similar but without islice: def checkio(words): return any(all(map(unicode.isalpha, trigram)) for trigram in zip(*(words.split()[i:] for i in range(3)))) http://www.checkio.org/mission/three-words/publications/hezhe88/python-27/second/ More
Again-veky 1
If anyone is also wondering how filter function eliminates zeros: https://docs.python.org/2/library/functions.html#filter "[item for item in iterable **if item**] if function is None." More
Using Counter and itemgetter-jrebane
This might be an O(nlogn) solution. Can you do it in O(n)? More
First-therods95
Each time text.count(x) is called, it requires O(n) time. So the total running time will be O(n^2). More