Skip to content

Team A Submission #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Team A Submission #15

wants to merge 2 commits into from

Conversation

14gabe14
Copy link

@14gabe14 14gabe14 commented Dec 3, 2022

CS Games 2023 Team A Application

Full Name

Gabriel Peralta

UWindsor Email

[email protected]

Application Form

Briefly explain how your solution works and how to run it

My solution uses a depth first search (DFS) algorithm. It iterates through the array and calls a helper function that performs DFS on every letter. If the first letter of the word does not match the letter in the board, or the indexes are out of bounds, it terminates the DFS function and returns false. In the next iteration, it calls DFS on all adjacent cells and passes a word with its first letter removed. In order to know if the algorithm already traversed a letter, it swaps the letter for a number before searching the adjacent cells. Once it finishes investigating the adjacent cells, it returns the number back to its original value.

To execute this code run the following command:

py solution.py

Then, insert the your input as shown in the example below and press enter to receive an output.

image

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