99 Elm Problems/Problem 16

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Drop every N'th element from a list.

import Html exposing (text)
import List

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

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

Result:

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

Solutions