Jump to content

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 pallSame(cs):
h = cs[0]
return all(h == c for c in cs[1:])
Line 364:
firstCharPrepended,
takewhile(
pallSame,
zip(*(reversed(x) for x in xs))
),
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.