K39
Generate Binary Strings
Problem Statement & Objective
Generate all valid binary strings of length n that satisfy given transition rules.
Function Signature (Python)
generate_binary_strings(n: int) -> list[str]Input & Output Contract
Output Rule:n uzunluğundaki bit dizgilerinin listesi.
System Constraints
1 <= n <= 12Example Execution Walkthrough
n = 2 -> ['00', '01', '10', '11']Example Test Scenarios (3)
Example 1
Input:
[2]Expected Output:
["00","01","10","11"]Example 2: n=1
Input:
[1]Expected Output:
["0","1"]Example 3: n=3
Input:
[3]Expected Output:
["000","001","010","011","100","101","110","111"]