17
han97
4 17 25
1606/ 1695
Khan Ag
Last seen 5 months ago
Member for 7 years, 10 months, 12 days
Difficulty Normal
Best reviews / Newest reviews
First-msmyxz 2
Better use join method of strings to concatenate strings More
First-Margaruga 1
U dont have to calculate len of intersection of sets. Read a formula in this article: [wikipedia](https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle) More
Numbers Factory - 2nd-narimiran 1
instead of "98765432", better write range(9, 1, -1) More
First-suic 1 1
Use getattr built-in function. For example: getattr(hashlib, "md5") -> hashlib.md5 More
pow/enumerate-makoto_yamagata 1
if u write if i == True: return True , shouldn't it work? less condition checking in the loop -> faster More
for loop & if statement-cierand 1 1
You should use built-in function called "len" instead of calculate it manually. Example: len([1, 2, 3]) retrieves 2. More
First-Kurush 1
better use deque of collections module, cause its faster. More
First-kurosawa4434 1
Look at this method: https://docs.python.org/2/library/stdtypes.html#str.zfill More
Chess knights move-hanpari 1 1
Creating a dict to check coordinates being in bounds? Isn't it faster to just check coordinates? like 0<=xMore
Recursion with cache-yoichi 1
if u used this, it would be easier:[python docs](https://docs.python.org/3.2/library/functools.html#functools.lru_cache) More
pow/enumerate-makoto_yamagata 1
I just realised that, pow(n, True, i) == n % i This is awesome, man :D More
First-Margaruga 1
And better use max function instead of implementing it More
First-Margaruga 1
for j, another in enumerate(words): if i != j: sumlikeness += calculate_likeness(word, another instead of calc it the C way, use sum fucntion. More
Co-ludek.reif 1 1
it is not fast, better use sets and intersection method (set1 & set2) More
bin(), str(), then count('1')-tommy6073 1
no need to str(). Bin retrieves a string More
One-liner-tomkun 1 1
use count method of string instead. and why do u use str() on bin returned value? bin returns str type More
Even the last 2-Ginger03 1
Better use slicing for it. Like this: array[::2]. First two parameters are for begin and end indexes. If you want whole list, you don't touch it (for example [1,2,3][:] will retrieve the same list). Third parameter is for "step". For array=[0,1,2,3,4,5] it will retrieve [0,2,4]. More
Simple-Gideon
Better use "join" method of strings. More
First-thibault.dereu
not very fast, mine is faster :D Checked with timeit for 19 rings: 12.9365308285 43.1890509129 More
1
2 3 4