Bytethematics
This week’s first task is almost a continuation of task II. Task 1: Binary Flip You are given a positive integer, $n. Write a script to find the binary flip. Example 1 Input: $n = 5 Output: 2 First find the binary equivalent of the given integer, 101. Then flip the binary digits 0 -> 1 and 1 -> 0 and we get 010. So Binary 010 => Decimal 2. Example 2 Input: $n = 4 Output: 3 Decimal 4 = Binary 100 Flip 0 -> 1 and 1 -> 0, we get 011.