Given a non-negative integer N return the number of binary strings of length N without 2 consecutive ones
Example:
Input: N = 3
Output: 5
Explanation: [
"000",
"001",
"010",
"100",
"101",
]
Notes:
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