Company: Teradata
Difficulty: medium
Binary Palindromic Number Problem Description 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. Examples Example 1: Input: 2 Output: 1 Example 2: Inpu