26
jullios1104
4 20 35
3847/ 3945
Юлия Селиванова
Last seen 2 hours ago
Member for 10 months, 19 days
Difficulty Easy
Best reviews / Newest reviews
First-Kurush 1
Difficult to read, but interesting how lambda, reduce, map functions are used in one expression More
Second-viktor.chyrkin 1
Wonderful. One of the clearest, fastest and simplest solutions. Logic and no unnecessary lists and dictionaries. Iteration and counting. How could I not have thought of this... More
bit_count-CDG.Axel 1
Great! This is a new int.bit_count() for me. This is a good alternative instead str.count('1'). More
First-faccanoni
A good solution using the zfill function, but a bit cumbersome More
One-liner-suic
What's amazing to me is the use of a lambda function and a template argument compiled directly into an expression. If I solved this mission using re, it would take me several lines. I'll definitely take note of this method. More
Convert to ints-amandel
What an elegant solution! It’s difficult to immediately figure out how to use the ord function and then look for the values ​​of the diagonal cells for the defenders among the input data. And there is no need for a chessboard in the form of an array More
First-rudnytskyi2007
Just a cool solution, and no ord function or arrays are needed. Pure logic. Wonderful More
List comprehension & zfill-rockwellshabani
I don't think this is faster than the (m^n).bit_count()solution but creative for sure More
First-Skyceer
A good approach to use the try-except construct if the string contains only integers and you need to find the sum of only integers. If you have numbers of the float type, but you need to find the sum of only integers, then it is better to use the .isdigit() check. More
F clear one liner return sum(map(int, filter(str.isdigit, text.split()))) with 4 lines of comments-piter239
I thought that such construction required a lambda function to access the elements of the list, i.e. filter(lambda x: x.isdigit(),list_). But you can use the default function str.isdigit and str will be the elements of list_. Great! More