Subset check using bitmask
Java
Hard
5 views
Problem Description
Task: given masks a and b, return true if b is subset of a (all bits in b also set in a).
Output Format
Return value
Constraints
Use (a & b)==b.
Official Solution
static boolean isSubset(int a,int b){return (a & b)==b;}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!