11
BoguslawKalka
8 23
604/ 645
Bogusław Kałka
Last seen 5 years ago
Member for 9 years, 8 months, 9 days
Difficulty Normal
Best reviews / Newest reviews
First-lancelote 1 1
Some optimization could be done: check if newly found palindrom (lines 6-7) is longer than longest already found, so you have to remember only one string, instead of list of strings. More
at last-Roberto_Carlos_Lopez_Ruiz 1
You can just compare lists returned by sorted - no need to ''.join() again for strings. Also after replace(' ', '') there is no need for strip() because there won't be any spaces to strip. More
First-bespontoff
This is memory-cpu dillema task. In above code year is calculated every time function is called: uses little memory, much more cpu. Another way is to calculate every year-opacity pair only once at beginning and save it to list. Uses more memory, but less cpu. As you did for "fibs" list - it is compu More
First-AnnaCho 1
Creative use of replace :) (of course there is str.endswith() which would be more apropriate in this task). More
First-lerikpav
Could be faster if lists where used instead of sets - no need to secondary check for characters count then. More
Verify_anagrams-Valeriy__Vasipov
You can write first_word.lower().replace() instead of (first_word.lower()).replace() - chaining of functions. Also "return a == b" is equivalent to, and easier to use, than "return (True if a == b else False)". More
try, degrees, acos-mellonkhv 1
Good idea with calculating ang_c from two previously calculated angs. Are you sure that try/except will catch every non-triangle data with ValueError and ang_a==0 checks? More
First-kittyofdeath
You can write "return sorted(first_word) == sorted(second_word)". More
Second-jcg
Great idea with inteligent sorting! More