|
1 | | -<h2><a href="https://leetcode.com/problems/word-search/">79. Word Search</a></h2><h3>Medium</h3><hr><div><p>Given an <code>m x n</code> grid of characters <code>board</code> and a string <code>word</code>, return <code>true</code> <em>if</em> <code>word</code> <em>exists in the grid</em>.</p> |
| 1 | +<h2><a href="https://leetcode.com/problems/word-search">79. Word Search</a></h2><h3>Medium</h3><hr><p>Given an <code>m x n</code> grid of characters <code>board</code> and a string <code>word</code>, return <code>true</code> <em>if</em> <code>word</code> <em>exists in the grid</em>.</p> |
2 | 2 |
|
3 | 3 | <p>The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.</p> |
4 | 4 |
|
5 | 5 | <p> </p> |
6 | 6 | <p><strong class="example">Example 1:</strong></p> |
7 | | -<img alt="" src="https://assets.leetcode.com/uploads/2020/11/04/word2.jpg" style="width: 322px; height: 242px;"> |
8 | | -<pre><strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED" |
| 7 | +<img alt="" src="https://assets.leetcode.com/uploads/2020/11/04/word2.jpg" style="width: 322px; height: 242px;" /> |
| 8 | +<pre> |
| 9 | +<strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED" |
9 | 10 | <strong>Output:</strong> true |
10 | 11 | </pre> |
11 | 12 |
|
12 | 13 | <p><strong class="example">Example 2:</strong></p> |
13 | | -<img alt="" src="https://assets.leetcode.com/uploads/2020/11/04/word-1.jpg" style="width: 322px; height: 242px;"> |
14 | | -<pre><strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE" |
| 14 | +<img alt="" src="https://assets.leetcode.com/uploads/2020/11/04/word-1.jpg" style="width: 322px; height: 242px;" /> |
| 15 | +<pre> |
| 16 | +<strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE" |
15 | 17 | <strong>Output:</strong> true |
16 | 18 | </pre> |
17 | 19 |
|
18 | 20 | <p><strong class="example">Example 3:</strong></p> |
19 | | -<img alt="" src="https://assets.leetcode.com/uploads/2020/10/15/word3.jpg" style="width: 322px; height: 242px;"> |
20 | | -<pre><strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB" |
| 21 | +<img alt="" src="https://assets.leetcode.com/uploads/2020/10/15/word3.jpg" style="width: 322px; height: 242px;" /> |
| 22 | +<pre> |
| 23 | +<strong>Input:</strong> board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB" |
21 | 24 | <strong>Output:</strong> false |
22 | 25 | </pre> |
23 | 26 |
|
|
34 | 37 |
|
35 | 38 | <p> </p> |
36 | 39 | <p><strong>Follow up:</strong> Could you use search pruning to make your solution faster with a larger <code>board</code>?</p> |
37 | | -</div> |
|
0 commit comments