1. Determine whether there is a set that meets the conditions

` / [' cash ', 'contract', 'img] $/. The test (' img) / / return true `Copy the code

2. Obtain the first bit of the binary number

`(num >> (bit -1)) & 1`Copy the code