problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::jump_game_ii::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static int jump (vector< int > &nums)
 

详细描述

在文件 leetcode.h2442 行定义.

成员函数说明

◆ jump()

int leetcode::jump_game_ii::Solution::jump ( vector< int > &  nums)
static

在文件 leetcode.cpp6548 行定义.

6548 {
6549 const int n = nums.size();
6550 int ans = 0;
6551 int last = n - 1;
6552 while(last != 0) {
6553 for(int i = 0; i < n; i++) {
6554 if(i + nums[i] >= last) {
6555 last = i;
6556 ans++;
6557 break;
6558 }
6559 }
6560 }
6561 return ans;
6562 }

被这些函数引用 leetcode::jump_game_ii::TEST().


该类的文档由以下文件生成: