DEV Community

loading...

Discussion on: Daily Challenge #172 - Find All in an Array

Collapse
aminnairi profile image
Amin

Elm

import List exposing (indexedMap, filter, map)
import Tuple exposing (pair, second, first)


findAll : List Int -> Int -> List Int
findAll integers integer =
    indexedMap pair integers
        |> filter (second >> (==) integer)
        |> map first

Implementation.