← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given an m x n 2D grid of characters board and a string word, return true if the word exists in the grid, otherwise return false. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring a cell, and the same letter cell may not be used more than once.
m and n are the number of rows and columns in the grid.word is composed of lowercase English letters.Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]word = "ABCCED"Output:
trueExplanation:
Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]word = "SEE"Output:
trueExplanation:
Input:
board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]word = "ABCB"Output:
falseExplanation:
Input:
board = []word = "ABCB"Output:
falseExplanation: