Skip to content

Commit a15d0d1

Browse files
committed
Create README - LeetHub
1 parent 0e323e5 commit a15d0d1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h2><a href="https://leetcode.com/problems/out-of-boundary-paths/">576. Out of Boundary Paths</a></h2><h3>Medium</h3><hr><div><p>There is an <code>m x n</code> grid with a ball. The ball is initially at the position <code>[startRow, startColumn]</code>. You are allowed to move the ball to one of the four adjacent cells in the grid (possibly out of the grid crossing the grid boundary). You can apply <strong>at most</strong> <code>maxMove</code> moves to the ball.</p>
2+
3+
<p>Given the five integers <code>m</code>, <code>n</code>, <code>maxMove</code>, <code>startRow</code>, <code>startColumn</code>, return the number of paths to move the ball out of the grid boundary. Since the answer can be very large, return it <strong>modulo</strong> <code>10<sup>9</sup> + 7</code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<img alt="" src="https://assets.leetcode.com/uploads/2021/04/28/out_of_boundary_paths_1.png" style="width: 500px; height: 296px;">
8+
<pre><strong>Input:</strong> m = 2, n = 2, maxMove = 2, startRow = 0, startColumn = 0
9+
<strong>Output:</strong> 6
10+
</pre>
11+
12+
<p><strong class="example">Example 2:</strong></p>
13+
<img alt="" src="https://assets.leetcode.com/uploads/2021/04/28/out_of_boundary_paths_2.png" style="width: 500px; height: 293px;">
14+
<pre><strong>Input:</strong> m = 1, n = 3, maxMove = 3, startRow = 0, startColumn = 1
15+
<strong>Output:</strong> 12
16+
</pre>
17+
18+
<p>&nbsp;</p>
19+
<p><strong>Constraints:</strong></p>
20+
21+
<ul>
22+
<li><code>1 &lt;= m, n &lt;= 50</code></li>
23+
<li><code>0 &lt;= maxMove &lt;= 50</code></li>
24+
<li><code>0 &lt;= startRow &lt; m</code></li>
25+
<li><code>0 &lt;= startColumn &lt; n</code></li>
26+
</ul>
27+
</div>

0 commit comments

Comments
 (0)