Company: Teradata_6thaug
Difficulty: medium
Binary Palindromic Number Problem Description You are given a positive integer N. You want to turn it into a binary palindromic number - a number whose binary representation reads the same forwards and backwards. You may apply the following two operations any number of times: Increase the value of the number by 1. Decrease the value of the number by 1. Find the minimum number of operations required to turn N into a binary palindromic number. Note: A number is always written with the minimum number of bits, that is, without leading zeros. For example, 6 is 110 (not 0110 ), so 6 is not a binary palindromic number. Each input contains several independent queries; answer each one separately. Function Description Complete the function solve . It takes one parameter and returns the minimum number of operations for that single number. num : the number N. Input Format The first line contains an integer T, the number of queries. (inferred - the source lists a bound on T but never shows the inpu