34
DiZ
14 34 43
7059/ 7195
Last seen 2 years ago
Member for 11 years, 6 months, 10 days
Difficulty Normal
Best reviews / Newest reviews
Bellman–Ford-ish (short)-StefanPochmann
Nice approach. I feared no one else used Bellman-Ford, you proved me wrong ;-) More
First-RandyWaterhouse
I think your code can be clearer if instead of if ord(cstring[i+3]) in range(48, 58): you use if cstring[i+3].isdigit(): More
texas-referee --> s7even-s7even 1
Why not use strings for _ranks_ and _suits_? String is also iterable. ranks, suits = '023456789TJQKA', '0scdh' You can also write your _hand_ variable like this: hand = {h: 10 ** n for n, h in enumerate(['0', 'HC', 'OP', 'TP', 'TK', 'St', 'Fl', 'FH', 'FK', 'SF'])} Or even nicer: han More
Finite state machine-veky 1
A very elegant solution! Tempted me to come back to Prolog. More
Binary & Complex-DiZ 1
Tested with Vinc maze and 4 rooms test :D Lines 22-26 are only here for optimization. More
First-LexCavalera
Solution working with float coordinates, great job! More
First-junjiru 1
Wrong category here. Speedy is for faster solutions. I don't think this one can be faster than nickie's solution for example, with so much branching/ More
Loop colomns in a quarter-macfreek
Good solution, but not very pythonist. I know it's an old one, but seems interesting to comment on it, to give tips to future readers. - First 2 lines: Python allows multi-initializations -> __full, total = 0, 0__ - _int(ceil(radius))_: ceil already generates an integer, no need to use int() on More
85-DiZ
A bit of explanation: this solution is based on coprime triplet (5,6,7). As they are coprime, for any n < 5 * 6 * 7=210, {n%i | i in (5,6,7)} will be unique. So, without counting first random try, we can recognize all n < 100 in 3 steps - that is the minimum with divisors <= 10. More
First-coells
sorted([...])[-1] What about? max(...) More
Could be shorter :p-DiZ 1
Obviously false, but tests are so permissive. More
Supercover line-DiZ
When I saw Spoty made an [implementation](http://www.checkio.org/mission/bats-bunker/publications/spoty/python-27/first/) based on the same algorithm, I decided to keep same structure. Feel free to compare. More
Floyd–Warshall rev2-natsuki
An algorithm with O(n^6) complexity for this task... really frightening... Especially when Floyd-Warshal has a O(n^3) complexity on a n x n matrix. Your function *all_cells* introduces a O(n^2) complexith when you only need to do: for k in range(n): for i in range(n): for j More
dimpleqonx-veky 1
Amazing! How did you find this?! More
First-Force 1
Here sum(a>b for ...) - instead of sum( for ...) - is all you need ;) More
Borders-DiZ
Do you know that Python has [complex number](https://en.wikipedia.org/wiki/Complex_numberg) support? They are often you to represent a grid in 2D, so `x + 1j * y` represents a point at coordinates _(x, y)_. There is a trick with the second line: `[1j ** k for k in range(4)] produces [1, 1j, -1, - More
1 2
3