Convert a given integer to binary. Return 1 when ANY odd bit of x equals 1; 0 otherwise.
Examples
any_odd(2) will return 1 because at least one odd bit is 1 (0010).
any_odd(170) will return 1 because all of the odd bits are 1 (10101010).
Tests
any_odd(5)
any_odd(7)
any_odd(10)
Good luck!
This challenge comes from mtruong1999 on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!