32
Artur Alexandrov
Last seen 25 days ago
Member for 1 year, 6 months, 19 days
Difficulty Easy
Maybe this solution is not easy to grasp at first glance, bul it looks rather accurate, definitely better than mine with tones of elifs))
More
Maybe instead of two lines:
n = int(a)
x = x + n, you can do it with one: x += int(a).
Well done!
More
Yes, regex can make your life much easier, solving string tasks, but learning them demands time and lots of perseverance.
More
In your first solution you could unpack the value and turn every element to integer with one line like this:
list = [int(i) for i in str(value)]
You would get the list of numbers, from which you can get the highest value just using the max function.
More
Great. It's a really good implementation of Counter method for solving this excercise. Well done.
More
Very nice example of using utility function for solving this task. I suppose the benefit of using yield statement instead of return in get_neighbours function is just better time efficiency?
More