Longest common suffix: Difference between revisions
m
→{{header|Python}}: Named the allSame predicate
(→{{header|Python}}: (replaced `reversed` and a comprehension) with reduce) |
m (→{{header|Python}}: Named the allSame predicate) |
||
Line 355:
strings in xs.
'''
def
h = cs[0]
return all(h == c for c in cs[1:])
Line 364:
firstCharPrepended,
takewhile(
zip(*(reversed(x) for x in xs))
),
|