17
DerryK
4 14 29
1515/ 1695
Derry Kabcenell
Last seen 1 year ago
Member for 7 years, 6 months, 5 days
Difficulty Normal
I was a professional software developer for Xerox (Mesa) and Oracle (mostly C) for about twenty years, but after a number of years in management and executive positions, and then retirement, I'm strictly an amateur. I value simple, elegant and easy-to-read solutions to programming problems, with brevity also a strong consideration, and performance important when there is a reason to prioritize it.

Best reviews / Newest reviews
Fast brackets-hanpari 2 1
Nice use of sentinel at the bottom of the stack. A very minor suggestion: You could replace the last two lines with return len(res) == 1 More
[py3.8+] 1-liner/98 chars with walrus/shifts operators-Phil15 1 1
Beautifully simple. I'm wondering how you came up with the n//10 approximation. Is it a binary expansion of 0.1? More
First-Ziemowit_Soko_owski 1
Very nice use of sentinel at the bottom of the stack. You don't need parentheses around if conditions like you do in C, and the first if condition could be 'i in ["[", "{", "("]' to be a little neater. More
First, with some help of Sim0000!-Thenbacker 1
I like your use of a queue to keep track of teleports to be tried, and "len(set(path))" to see if you've reached all nodes. More
First-Ziemowit_Soko_owski 1
Simple and straightforward. Except you could replace the "elif len(sor) %2 == 0" with a simple "else"; there are no other choices but 1 and 0. More
First-portamundos 1 1
Python can explode the date arguments for you: Use "date(*d1)" instead of "date(d1[0], d1[1], d1[2]). More
First-mortonfox 1
Nice use of join to solve the separator problem! More
First-montey
You can let Python do the work of exploding the dates, using "date(*date1)". Also, the result of (d2 - d1).days is an integer, so you can use abs instead of fabs. More
First-k33theod 1
I'm afraid I can't tell how this works... More
First-Dariusz_Malagowski
Note that you can allow Python to explode the dates for you: date1 = date(*date1) More
First-ylrih
One suggestion: You wouldn't have to do the string replacement of 33, 222, etc. if you start with larger factors and count down to smaller ones -- if you get to 4, for example, and have found all the factors, you never need to try 3 and 2. Also, I don't think you need to test any factors above 9 sin More
Second-kaiszi
Straightforward and clear. Nice job. More
O(log number)-ottosmo
Nice. My solution is similar, but I didn't think of using reduce to create the final result. More
First-stas6626
I'm voting for this solution because I like Cyrillic -- even though I can't read a word of it. More
First-parroty
Looks good. One observation is that don't have to go through the whole range of possible factors if you start at 9 and go backwards. Once you find adequate factors in the upper end of the range, you don't need to check the lower end since any digits down there will only make the result number longer More
First-PythonicB 1
I believe this will work. I have two suggestions: 1. There's a comment that says "Create new list with non-unique elements". I think this means that you shouldn't modify the original list by removing elements, though I'm not sure. 2. You don't need to make the second call to "data.count(element)". I More
First-bazcrown
Simple and straightforward. A couple of notes: In line 4, there are some extra parentheses surrounding the index that you don't need; and it is not necessary (but perfectly permissible) to use 2.0, a float, in line 6; in Python 3 the division will be floating point regardless of the arguments. More
Second-tsebell
Looks good. My only suggestion would be to use sorted(data) and a new local variable, rather than sorting "data" in place. The caller might be unhappy if he/she is not expecting the argument to be changed. More
First-Mateusz_Tomkowiak
Looks good. You could shorten it a bit by just making the list of Fibonacci numbers a variable, say "fibonaccis", and replacing "isFibNumber(age)" by "age in fibonaccis". More
First-bartorbard
Very nice. I was thinking of trying to use eval. More
1
2 3