Generation of Combinatorial Objects · Gray Codes
Lesson 3
Programming problem.
Write a program that reads an integer \(1 \le n \le 10\) and outputs all binary sequences of length \(n\) such that every two adjacent sequences (as well as the first and last) differ in exactly one position.
Public samples
Input
1
Expected output
0 1