#๐ DFS in matrix
9 messages ยท Page 1 of 1 (latest)
@regal pecan
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
code works fine and as expected
however
print(clean_path([['D', 'D'],
['E', 'E'],
['E', 'X']]))```
my code is essentially a roomba where 'X' represents the vaccuum and 'D' represents the dirt (and 'E' is just empty)
it'll go and use the directions so that it'll clean up the dirt then return to its original starting position.
so this output of this test case would be:
['u', 'l', 'u', 'r', 'd', 'd']
however my code is really long and I think there is a better way to go about this approach.
if anyone can leave any ideas, would greatly appreciate it
.close
!close
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.