99 門榆樹問題/問題 16
外觀
< 99 門榆樹問題
從列表中丟棄每一個第 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]
從列表中丟棄每一個第 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]