49
Phil15
30 56 64 Leader of the month
23067/ 25141
Last seen 3 hours ago
Member for 6 years, 2 months, 27 days
Difficulty Advanced
I was a math teacher in France for two years. I'm currently reconverting to IT, I'm here to improve my Python skills, and practice English.

Best reviews / Newest reviews
*Light Up Solver-JimmyCarlos 1 1
First, great job you did it!! It was though, right? I hope you enjoyed it :-) Line 137, I would have write except AssertionError instead of catching every exception? Maybe it catch the exceptions you raise too? I would have do this class SolverError(Exception): pass # then raise Solver More
7-liner: guessing accumulate idea-przemyslaw.daniel 1 1
I would say this is more creative than clear (for merger and last line) but it's great that you do the job with 7 lines. More
First-Sillte 1 1
Wow, more than three hundred lines of code/comments before my checker function. Impressive. I hope you enjoyed it enough! It's not that obvious, looking at it ^^ I don't have the courage to read it right now but I will try someday. Right now, I only have the keywords: constraints, backtracking, OO More
First-Sillte 1 1
Great job, you did it!! :-) Yeah, copy huge things or very often is time consuming. Naive DFS is not really possible here. It can be interesting but only for small searches. I'm not sure reading your code: are you using arrows in both ways? (if my question is clear enough...) Or can you explicit More
Short but inefficient-HeNeArKr 1 1
There is, hopefully, another way to guarantee that without sorting the entire set, your key function just have to be more precise, with lexicographic order. lambda x: (abs(x-target), x) More
Cleaned version, should be reable, it's fast and efficient-Ylliw 1 2
You told me that your solution is slower than mine (absolutely no shame in that, you solved it and it was definitely not a moderate mission, right?). I didn't read all your code but it seems you use `deepcopy` a lot, I can bet it takes you some time. my code don't do any copy of anything (well, ther More
First-colinmcnicholl 1 1
Private messages could be useful. You removed your entire forum post, not just the last comment. So I don't really have a proper way to contact you. I see where is your mistake, your justified lines ends with whitespaces. Otherwise, it's good and can pass all tests. This message will be removed af More
No lambda, 14 variables-PythonWithPI 1
It's because you can access builtins (thanks to `vars()`) as a dict and not as a module like it should be, so this would not work outside checkio editor. Maybe I should have forbidden divmod function in builtins. (I suppose it calls it somehow, it's hard to decode with vowels replaced by "a".) Then More
First-Sillte 1 1
`lambda x: str.strip(x)` is the same as `str.strip`, just more complicated. Comments this way seems unusual to me: `# Currenlty, only ``int`` is considered.` for example. More
First-colinmcnicholl 1 1
Great job with numpy! Even if I prefer my way with complex numbers. `cmath` module could do a part of the job for you. And there is probably a way to do graham stuff with complexes. `a[randint(0, len(a) - 1)]` or `choice(a)` (from random too). `del sorted_pts[...]`, not `sorted_pts.pop(...)` ? More
First-aya.kanazawa 1
`roots` could be a list instead of a dict. More importantly, since you only need the last element in roots, root could be the last element. roots = [(1, w_count, b_count)] for _ in range(1, step + 1): # don't need n variable anymore nlist = [] for root in ro More
First-brispol19 1 1
# line 8 type(tree[0]) is str or type(tree[0]) is int # or isinstance(tree[0], (str, int)) # line 19 [x for x in iterate(tree)] # or list(iterate(tree)) # line 27 tree = False # or just break # since it does the does the same thing in a clear way More
First-yoichi 1
for subtree in tree[1]: if result := find_node(subtree, node): # python 3.8+ return result # No need to return None, it returns None when it does not encounter any return statement. You call `find_node` a lot. Hopefully I did not provide too big trees in random tests. More
may the force be with you-juestr 1 1
I'm not sure I would call it clear, but I like the way your getter/setter functions manage multiple arguments, and the use of `reduce` I think. More
Recursion-Freez 1
`min` has a default parameter that can be useful. And `len` is great function on its own. min(variants, key=lambda x: len(x)) if variants else False min(variants, key=len, default=False) More
BFS-rossras 1
Sum comprehension is great. def is_adjacent(i, j): '''Return true if x and y differ by one digit, false otherwise''' return sum(i_digit != j_digit for i_digit, j_digit in zip(str(i), str(j))) Great job! More
Combinatorics and nothing else-Vasily__Chibilyaev 1 1
`0 if m==n else 1` or just `m != n`. Booleans are integers 0 and 1, so we can sum them. More
Lambda with filter-swagg010164 1
No need to have sets. ranges are enough. Test if a number is in a range is fast too. More
find path-Olpag 1 1
Just in case you don't know from collections import defaultdict graph = defaultdict(list) # then graph[num1].append(num2) # instead of graph[num1] = graph.get(num1,[]) + [num2] Or without collections module graph.setdefault(num1, []).append(num2) More
Zigzag McQuack-Ilis 1 1
About `[[]] * rows`, be careful. >>> L = [[]] * 5 >>> L[0].append(1) >>> L [[1], [1], [1], [1], [1]] # Same object five times. More
1 2 3
4
5 6 7 8 9 10 11 12 13