Given a binary string s and a positive integer n, return true if the binary representation of all the integers in the range [1, n] are substrings of s, or false otherwise.
A substring is a contiguous sequence of characters within a string.
Example 1:
Input: s = "0110", n = 3 Output: true
Example 2:
Input: s = "0110", n = 4 Output: false
Constraints:
1 <= s.length <= 1000s[i] is either '0' or '1'.1 <= n <= 109Solutions for this problem are being prepared.
Try solving it yourselfAdd Binary - Leetcode 67 - Python • NeetCode • 73,772 views views
Watch 9 more video solutions →Practice Binary String With Substrings Representing 1 To N with our built-in code editor and test cases.
Practice on FleetCodePractice this problem
Open in Editor