跳轉至正文

99 門榆樹問題/問題 16

來自維基百科,面向開放世界的開放書籍

從列表中丟棄每一個第 N 個元素。

import Html exposing (text)
import List

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

main = text <| toString <|
  dropEvery 3 [1..10]

結果

[1, 2, 4, 5, 7, 8, 10]

解決方案

華夏公益教科書