Pregunta de entrevista de IBM

Two leetcode problems, using binary operations.