Elixir Check Palindrome
defmodule CheckPalindrome do
def check_palindrome(input_string), do: String.reverse(input_string) == input_string
end
This compares the string with its reverse. If they match, it is a palindrome.
defmodule CheckPalindrome do
def check_palindrome(input_string), do: String.reverse(input_string) == input_string
end
This compares the string with its reverse. If they match, it is a palindrome.