跳轉到內容

99 Elm 問題/第 20 個問題

來自華夏公益教科書,為開放世界提供開放書籍

從列表中移除第 N 個元素。

import Html exposing (text)
import List

removeAt : Int -> List a -> List a
-- your implementation goes here

main = text <| toString <|
  removeAt 2 [1..4]

結果

[1, 3, 4]

解決方案

華夏公益教科書