37
YASSIF
https://github.com/yyassif
Last seen 4 days ago
Member for 3 years, 8 months, 16 days
Difficulty Normal
The Fox!
I liked the idea except the documentation was in Russian so I didn't understand what you wanted to say.
More
Weel, I won't say I enjoyed reading it but Nice solution so far :D
More
I would suggest else if you want: **filter** can do the job + the dunder **\_\_len__**
list(filter(lambda i: i.isdigit(), list(text))).__len__()
Good Luck, See you soon!
More
It could be made as one-liner solution:
checkio = lambda data: [i for i in data if data.count(i) != 1]
The only thing I'd like to say is that (data.count(i) != 1, data.count(i) > 1) operators both do the same condition!
I mean:
checkio = lambda data: [i for i in data if data.count(i) > 1
More
BTW You cam compress Both functions into one and OFC It's gonna be Function recursion But mainly it would like you're flattening the tree object of objects!
But I liked the idea of splitting the function so It would be more comprehensive and clear!
More
Since you already have the answer you could make parameter's default value:
def friday(day, fridays=[4,3,2,1,0,6,5]):
return fridays[datetime.datetime.strptime(day, '%d.%m.%Y').weekday()]
More
I am shocked! I would vote +200 if it was possible!
This is best the solution That made my day today HHHH..
More
It does take a little of time to find all possible paths which consumes more memory, but if you tried to encounter the second element while you pathfind it would be much more effective and less memory-consuming. But I liked your approach since you try to encounter every single match which can be ver
More
Well Done!
Nice use of itertools.count although using infinite loops in your code is a bit risky, however, you did perfectly.
More
Your 4th line is a little bit stressed, I would recommend the following, Instead of:
arry = list(map(lambda i:i.replace(' ', '').lower(), text.split('\n')))
For Example I'd omit all of the map, list and lambda to minimize time complexity to the following:
arry = text.lower().replace(' ', '
More