Binary strings of given length in reverse order
Problem
Given number N print all strings of length N consisting of zeros and ones in reverse lexicographical order.
In solving the problem, use enumeration of all subpatterns.
Input
Single number N specified. (1 ≤ N ≤ 10)
Output
It is necessary to output all strings of length N consisting of zeros and ones in reverse lexicographical order.
Input |
Output |
2 |
eleven
10
01
00
|