Skip to content

Latest commit

 

History

History
77 lines (30 loc) · 1.19 KB

File metadata and controls

77 lines (30 loc) · 1.19 KB

Description

Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return true if and only if for every integer X from 1 to N, the binary representation of X is a substring of S.

 

Example 1:

Input: S = "0110", N = 3

Output: true

Example 2:

Input: S = "0110", N = 4

Output: false

 

Note:

    <li><code>1 &lt;= S.length &lt;= 1000</code></li>
    
    <li><code>1 &lt;= N &lt;= 10^9</code></li>
    

Solutions

Python3

Java

...