Skip to content

79. word search go #290

Open
Open
@AvaniD19

Description

@AvaniD19

Base Case Check: In your search Word function, you should check if index is equal to Len(word) - 1, but also need to ensure that the character at index matches the character at the current position before returning true. You should adjust this condition to account for reaching the end of the word correctly.

Visited Check: You should also ensure that the last character in the word is checked correctly.

Key Changes:
Base Case Update: The base case now checks if index is equal to Len(word), indicating a full match of the word.
Boundary and Match Check: The conditions in search Word ensure the current cell is valid, not visited, and matches the corresponding character in the word before proceeding.
Backtracking Logic: The backtracking logic is preserved but placed correctly to ensure valid states.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions