Company: nvidia_7oct
Difficulty: medium
Binary String Power of Two Regex Match Problem Description Given a binary string, write a regular expression that matches it exactly when interpreting the string as a base-2 number yields a power of two. 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: Interpreted as decimal, this string equals 42, which is not a power of 2, so the regex must reject it and the code stub prints '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