Decode a packed integer into a dictionary of named boolean flags.
Constraints
Example
>>> parse_flags(9, {'debug': 0, 'verbose': 3})
{'debug': True, 'verbose': True}
>>> parse_flags(0, {'a': 1, 'b': 0})
{'a': False, 'b': False}
>>> parse_flags(1, {'alpha': 0, 'beta': 2})
{'alpha': True, 'beta': False}
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints