Find all n-digit binary numbers with k-bits set where `k` ranges from 1 to `n`
Write a program to print all n–digit binary numbers with k–bits set where k ranges from 1 to n. The numbers with the same number of bits set should be printed together in ascending order.