IBM Interview Question

Two leetcode problems, using binary operations.