13
CalebA.Kelley
10 27
744/ 845
Caleb Kelley
Last seen 4 years ago
Member for 9 years, 2 months, 8 days
Difficulty Normal
Best reviews / Newest reviews
First-timqsh 1 1
You should use super() so that the value isn't tethered to the base class. For this application, there won't be any problem. But subsequent changes to the base class could result in problems later on in bit projects. More
First-nsnsr2015
Much more elegant than my solution! More
First-v0id 1
I always like using default dict myself. Didn't think to use it on this one though. More
First-ForeverYoung
Nice solution, I had the same idea more or less. More
First-mr.floppy
I had the same thought; only a little more convoluted ;) More
recursion-Cjkjvfnby
I learned a lot today from the confusion this caused me. Thanks man! More
Keep or break the ring with a maximum of rings connected to it, that's the question-Phil15 1
I know this is a recursive solution, but could you walk me through your rational behind this solution? I would really appreciate learning from this solutions. More
First-nicole.miller
This is pretty succinct. I like it. More
First-fire123hummer
Another approach to this problem would be to use the regular expression engine. You should check it out. I used the re.findall function: re.findall([a-zA-Z]+[\']?[a-zA-Z]?, text). The '+' operator is the greedy lookpup operator, so that first pattern is looking for as many upper/lowercase characters More
1-liner: replace & find-przemyslaw.daniel
This is pretty awesome. Deleting the first instance, then searching for the character,then remembering to add one to the index since you removed a character before finding the second occurrence. Then using True/False as an index selector. Pretty cool. +1 More
First-vapekreng
Instead of using find, you could have use text.index(begin) and text.index(end) to find the index, you could also use try/except. In except you could use the default of start = 0, and end = len(text). More
First-Kairat 1
This is nice and short, and it has fault tolerance. But, if I were to ask you to find the nth occurrence of the sub-string in text, multiple nested function calls could get pretty ugly, and maybe inefficient. More
Regex/translate-martin_b 1
I think that I understand the regular expression matching pattern. But I don't understand how you have used a lambda. From my understanding, the re.sub takes a matching pattern, a function accepts a match object(here you created a lambda to swap the values of '.' and ',' on match group zero), t is t More
First-brownie57
Nice use of string slicing. Cool solution. More
Using Deque and String.ASCII-cryptozhunter
I like this. I did the same thing but I didn't use deque.Clear and easy to follow. More
First-strawrabbit
This is pretty good, it shows you have a working algorithm. But consider, instead, if you were to shift all of the values in alpha, by delta. Then you could get an inline relationship to alpha and shifted_alpha. From there one loop would give you the answer. Good job. More
First-vapekreng
This is too much. Just use f-strings or the format() function. More
First -- find centers of Palindromic and expand them, then find the longest-wyf.141060
Can you please break this down for me. What is the rational in using these two lambda functions in the way you have. I'm trying to learn a little more. More
First-Satoshi_Ogata
This is a pretty cool use of the eval and generator expressions. More
First-wntjdals2015
The range function doesn't require you to specify the starting point to zero, it is zero by default (python is 0-indexed based. Also, you should check out list comprehensions. As simple as this is coded, you could have maybe made it more readable with a list comp. More
1
2