O68
Word Search in Grid
Problem Statement & Objective
Given an m x n grid of characters board and a string word, return True if word exists in the grid.
Function Signature (Python)
exist_word(board: list[list[str]], word: str) -> boolInput & Output Contract
Output Rule:True veya False.
System Constraints
m == tahta.length, n == tahta[i].length
1 <= m, n <= 6
1 <= kelime.length <= 15
tahta ve kelime büyük/küçük İngilizce harfler içerirExample Execution Walkthrough
tahta = [['A','B','C','E'],['S','F','C','S'],['A','D','E','E']], kelime = 'ABCCED' -> True
kelime = 'ABCB' -> 'B' iki kez kullanılamaz -> FalseExample Test Scenarios (3)
Example 1
Input:
[[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]],"ABCCED"]Expected Output:
trueExample 2
Input:
[[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]],"SEE"]Expected Output:
trueExample 3: Tekrar Kullanım
Input:
[[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]],"ABCB"]Expected Output:
false