Skip to content

Add LeetCode solution 00874#69

Merged
eselyavka merged 1 commit intomasterfrom
leetcode-00874-walking-robot-simulation
Apr 8, 2026
Merged

Add LeetCode solution 00874#69
eselyavka merged 1 commit intomasterfrom
leetcode-00874-walking-robot-simulation

Conversation

@eselyavka
Copy link
Copy Markdown
Owner

@eselyavka eselyavka commented Apr 8, 2026

Summary

  • replace the existing 00874 implementation with a simpler direction-index simulation
  • track obstacles in a set for O(1) collision checks while moving step by step
  • extend the inline unittest coverage with both LeetCode examples and a no-movement edge case

Testing

  • ~/.venv/py3_11/bin/python -m pytest -q practice/leetcode/solutions_00600/solution_00874.py
  • pre-commit hook during git commit ran the full repo test suite: 802 passed
  • pre-commit hook during git commit ran pylint on the changed Python file: 10.00/10

Notes

  • the previous version could return -inf when the command list never moved the robot; the updated implementation returns 0 for that case

@eselyavka eselyavka merged commit 24eaf67 into master Apr 8, 2026
4 checks passed
@eselyavka eselyavka deleted the leetcode-00874-walking-robot-simulation branch April 8, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant