Skip to content

Commit

Permalink
Update exercises/practice/allergies/.approaches/bitwise-and-list/cont…
Browse files Browse the repository at this point in the history
…ent.md

Co-authored-by: Jie <jie.gillet@gmail.com>
  • Loading branch information
ceddlyburge and jiegillet authored Mar 9, 2024
1 parent 41afdfe commit a4e4f01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ isAllergicTo allergy score =

## In this approach

This approach implicitly uses the index of an item in a list to represent the bit position for the allergy score.
This approach implicitly uses the index of an item in a list to represent the bit position (minus one) for the allergy score.

[`List.indexedMap`][list-indexed-map] is used to map the list and provide the index of each item, it retains the `Allergy` and adds the bit mask in a tuple.
[`List.filter`][list-filter] then filters out any `Allergy` in the list where the bit mask doesn't match the score using [`Bitwise.and`][bitwise-and].
Expand Down

0 comments on commit a4e4f01

Please sign in to comment.