I normally count
def func(x): return whatever
as one line, so by that metric this one is 0
First 0-line solution I've seen
I am fully aware that this sucks
The reversal is memory-intensive for large arrays, I could have used next() syntax to achieve the same thing with the reversal generator.
Also, I forgot about .append()
turning string.upper() into a list is redundant - you can get the same result by just doing len(string).
Disappointing lack of pigeonhole principle in the solutions I've seen. You want to make a set out of a million-character string?
Loading collection data...
I normally count
def func(x):
return whatever
as one line, so by that metric this one is 0
First 0-line solution I've seen
I am fully aware that this sucks
The reversal is memory-intensive for large arrays, I could have used next() syntax to achieve the same thing with the reversal generator.
Also, I forgot about .append()
turning string.upper() into a list is redundant - you can get the same result by just doing len(string).
Disappointing lack of pigeonhole principle in the solutions I've seen. You want to make a set out of a million-character string?