Skip to content

Commit

Permalink
Update exercises/practice/allergies/.approaches/introduction.md
Browse files Browse the repository at this point in the history
Co-authored-by: Jie <jie.gillet@gmail.com>
  • Loading branch information
ceddlyburge and jiegillet authored Mar 9, 2024
1 parent 431ebec commit c78d638
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/practice/allergies/.approaches/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ allergiesAndScores =
toList : Int -> List Allergy
toList score =
allergiesAndScores
|> List.Map (\allergyAndScore -> ( 2 ^ allergyAndScore.bitPosition, allergyAndScore.allergy ))
|> List.map (\{bitPosition, allergy} -> ( 2 ^ (bitPosition - 1), allergy ))
|> List.filter (\( s, _ ) -> Bitwise.and s score > 0)
|> List.map Tuple.second
```
Expand Down

0 comments on commit c78d638

Please sign in to comment.