99 個 Elm 問題/問題 6
外觀
確定一個列表是否為迴文,即從前往後或從後往前讀取該列表時,得到的列表相同。
import Html exposing (text)
import List
isPalindrome : List a -> Bool
-- your implementation goes here
main =
isPalindrome [1,2,3,2,1] |> toString |> text
結果
True
確定一個列表是否為迴文,即從前往後或從後往前讀取該列表時,得到的列表相同。
import Html exposing (text)
import List
isPalindrome : List a -> Bool
-- your implementation goes here
main =
isPalindrome [1,2,3,2,1] |> toString |> text
結果
True