Company: TeraData
Difficulty: medium
Binary palindromic numbers Given a number N . You are required to convert it into a binary palindromic number. A binary palindromic number is a number whose binary representation is a palindrome. You can perform the following two operations on the provided number: Increase the value of the number by 1 . Decrease the value of the number by 1 . You are required to calculate the minimum number of operations required to convert the given number into a binary palindromic number. Note: The given number must be represented in the form of the minimum number of bits (ignoring the leading zeros in its binary representation). Function description Complete the solve function. This function takes the following parameter and returns the minimum number of operations required. Parameter: num : Represents the number N , on which you must use a minimum number of operations, to convert the given number into a binary palindromic number. Input format for custom testing Note: Use this input format if you ar