The logic of the code is based on counting the number of possible combinations of taking 1 or 2 steps to reach the n-th stair. The formula 1 + n / 2 effectively counts all the unique ways you can balance 1-stair and 2-stair steps to reach the top.
Fixes: #[issue_number] (replace with the issue number, if applicable)
Use [x] to represent a checked (ticked) box.✅
Use [ ] to represent an unchecked box.❌
Type of Change
[ ] Question Added
[ ] Solution Added
[ ] Other (please specify):
Checklist
[ ] I have performed a self-review of my code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have made corresponding changes to the documentation (if applicable).
[ ] My changes generate no new warnings.
[ ] I have added tests to cover my changes (if applicable).
"gfg potd 4th sep problem added "
Description
The logic of the code is based on counting the number of possible combinations of taking 1 or 2 steps to reach the n-th stair. The formula 1 + n / 2 effectively counts all the unique ways you can balance 1-stair and 2-stair steps to reach the top.
Fixes: #[issue_number] (replace with the issue number, if applicable)
Use [x] to represent a checked (ticked) box.✅ Use [ ] to represent an unchecked box.❌
Type of Change
Checklist