< 99 Elm Problems

Determine if a list is a palindrome, that is, the list is identical when read forward or backward.

import Html exposing (text)
import List

isPalindrome : List a -> Bool
-- your implementation goes here

main = 
  isPalindrome [1,2,3,2,1] |> toString |> text

Result:

True

Solutions

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.