Add get_word_path function to word_search.py - #14511
Conversation
for more information, see https://pre-commit.ci
|
@priya-sundaram-dev review please as a potential solution to #14500 |
|
Reviewed against #14500. The algorithm is correct — I ran it on the classic board
Two things needed before this can merge, both to match the house style already set by
Nit: the nested (The Nice, correct core; just needs the doctests + validation to be consistent with |
Added a new validation function to check the board and word parameters, ensuring proper input types and values. Updated existing function docstrings for clarity and consistency.
for more information, see https://pre-commit.ci
Refactor the validate_board_and_word function call for better readability.
Describe your change:
Implemented a new function
get_word_pathinbacktracking/word_search.py.This function returns the list of coordinates (row, column) representing the path of the given word in the board instead of just returning a boolean value.
Fixes #14500
Checklist: