Pergunta de entrevista da empresa IBM

Two leetcode problems, using binary operations.