Company: nvidia_7oct
Difficulty: medium
Binary String Power of Two Regex Match Problem Description Given a binary string, find a regex that checks whether that binary number when converted to a decimal number is a power of two or not. Complete the code in the editor below by replacing the blank (i.e., _______ ) with a regular expression that matches something according to the criterion above. Locked code in the editor prints True for each correct match and False for each incorrect match. Examples Example 1: Input: s = '0101010' Explanation: This is 42 decimal which is not a power of 2. The regex should return a false value and the code stub will print 'False'. Constraints Test strings consist only of ascii characters '0' or '1' Input Format For Custom Testing Input from stdin will be processed as follows and passed to the function. The first line consists of an integer, n, the number of binary strings to follow. Each of the next n lines contains a string representation of a binary number. Sample Input 0: 4 1000 0100 0010 011