This seems like a pretty simple problem, but I'm looking for a short and sweet way of doing it that is still understandable (this isn't code golf).
Given a list of strings, what's the easiest way to find the shortest string?
The way that is most obvious to me is roughly:
l = [...some strings...]
lens = map(l, len)
minlen, minind = min(lens)
shortest = l[minind]
but that seems like a lot of code for this problem (at least in python).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…