Given two integers n and k, return a list of all valid binary strings of length n sorted in lexicographical order.
A binary string is considered valid if it satisfies the following conditions:
It does not contain two consecutive $ ext{‘1’}$ characters.
The total cost of the string is at most k.
The cost of a binary string is defined as the sum of all
Constraints:
n
k
Given two integers n and k, return a list of all valid binary strings of length n sorted in lexicographical order.
A binary string is considered valid if it satisfies the following conditions:
It does not contain two consecutive $ ext{‘1’}$ characters.
The total cost of the string is at most k.
The cost of a binary string is defined as the sum of all
Constraints:
n
k