Given two non-negative integers N and K, return the number of binary strings of length N with exactly K ones placed only on even positions
Example:
Input: N = 6, K = 2
Output: 3
Explanation: [
"101000",
"100010",
"001010"
]
Notes:
2 * K <= N <= 30
Walkthroughs of the solution. Try the steps first, then watch to compare approaches.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check