Skip to content
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

Team A Solution #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Team A Solution #18

wants to merge 1 commit into from

Conversation

NorikaU
Copy link

@NorikaU NorikaU commented Dec 4, 2022

CS Games 2023 Team A Application

PLEASE FILL IN THE FOLLOWING!

Full Name

Norika Upadhyay

UWindsor Email

[email protected]

Application Form

Briefly explain how your solution works and how to run it

My solution is a function that takes in a 2D array of letters (board) and a string (word) and checks whether the string can be made using adjacent cells of the array by using depth first search. It starts by looking for the first letter of the word in the array, then checking if the next letter is in the adjacent cells in four directions. It keeps repeating this process until either the end of the string, in which case it returns True, or until the next letter cannot be found, in which case it returns False.

Run it on Python using function exist(board, word) where board is a 2D array of strings and word is a string.

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