Skip to content

Commit

Permalink
Update exercises/practice/allergies/.approaches/bitwise-and-dict/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 a19bd0f commit 93ccdec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ allergies =

toList : Int -> List Allergy
toList score =
Dict.foldr (\key value list -> if Bitwise.and (2 ^ key) score >= 0 then (value :: list) else list) [] allergies
Dict.foldr (\key value list -> if Bitwise.and (2 ^ (key - 1)) score > 0 then (value :: list) else list) [] allergies

isAllergicTo : Allergy -> Int -> Bool
isAllergicTo allergy score =
Expand Down

0 comments on commit 93ccdec

Please sign in to comment.