rosetta stone - Palindrome Golf -
the goal: language. smallest function return whether string palindrome. here mine in python:
r=lambda s:all(a==b a,b in zip(s,reversed(s)))
50 characters.
the accepted answer current smallest 1 - change smaller ones found. please specify language code in.
7 characters in j: not sure if best way, i'm new j :)
p=:-:|.
explanation: |. reverses input. -: compares. operands implicit.
p 'radar' 1 p 'moose' 0
Comments
Post a Comment