15
Last seen 7 months ago
Member for 8 years, 7 months, 3 days
Difficulty Normal
Nice solution, but it's rather creative than clear.
1 particular thing is range -> I'd change to range(1, 27) instead of doing
"i + 1" over and over again. In this case it doesn't really
affect performance at all, but it might in case of big ranges.
More
for idx, item in enumerate(items):
...
Stop using range(len(...)), use enumerate instead
More
you could directly return number or -1, without consuming memory to save it to variable
More
kind of long way to do things. Use enumerate to get indexes and sum only proper ones or even easier - use slicing (array[::2]) ;)
More
very nice and simple, especially when you added "9x" and "4x" to the dict, not just "regular" numbers ;)
More
nice solution, clean and simple yet tricky to make dict with all 4's and 9's
More
it's kind of misleading solution if first is returns True, then False and then everything else returns True... Would be better to return only True in "if's" and False after
More
clear solution. it's ok, although you are recalculating len(s) over and over again.
More
it's not 3rd party solution. and definitely not clear :(
More