GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode.cn — 1824. 最少侧跳次数 - 力扣(LeetCode) 题目描述 题目描述 题解 题解 提交记录 提交记录 中等 给你一个长度为 给你一个长度为
这只青蛙从点
这只青蛙从点 0 处跑道 注意:点
示例 1:
输入:obstacles = [0,1,2,3,0] 输出:2 解释:最优方案如上图箭头所示。总共有 2 次侧跳(红色箭头)。 注意,这只青蛙只有当侧跳时才可以跳过障碍(如上图点 2 处所示)。 示例 2:
输入:obstacles = [0,1,1,3,3,0] 输出:0 解释:跑道 2 没有任何障碍,所以不需要任何侧跳。 示例 3:
输入:obstacles = [0,2,1,0,3,0] 输出:2 解释:最优方案如上图所示。总共有 2 次侧跳。
提示:
代码 代码 测试用例 测试用例 测试结果 测试结果 |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |