Skip to content

Instantly share code, notes, and snippets.

@sushant12
Created May 17, 2020 03:50
Show Gist options
  • Save sushant12/18881d30104b7ddfcbd8935f3145fb32 to your computer and use it in GitHub Desktop.
Save sushant12/18881d30104b7ddfcbd8935f3145fb32 to your computer and use it in GitHub Desktop.
-module(palindrome).
-export([palindrome/1]).
palindrome(Xs) ->
Filtered = lists:filter(
fun(T) -> ((T >= $a) and (T =< $z)) or ((T >= $A) and (T =< $Z)) end,
string:to_lower(Xs)
),
Filtered == lists:reverse(Filtered).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment