pass-the-pillow: ZeroDivisionError when n=1
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Start in pass-the-pillow/solution.py at pillowHolder, where n=1 makes cycle zero. Reproduce the ZeroDivisionError with pillowHolder(1, t) for a positive t, then verify that the function returns 1 for this case without changing existing behavior for valid n values.
Written by the indexing model from the issue text.
Description
Calling `pillowHolder(1, t)` for any `t > 0` raises `ZeroDivisionError` because `cycle` is 0.
File: `pass-the-pillow/solution.py`
Impact: Latent bug masked by LeetCode's constraint `2 <= n`.
Suggested fix: Add guard for `n == 1`: return 1.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from benthomasson/leetcode-implementations
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
All issues in benthomasson/leetcode-implementations
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100