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

#include <leetcode.h>

静态 Public 成员函数

static bool asteroidsDestroyed (int mass, vector< int > &asteroids)
 

详细描述

在文件 leetcode.h201 行定义.

成员函数说明

◆ asteroidsDestroyed()

bool leetcode::destroying_asteroids::Solution::asteroidsDestroyed ( int  mass,
vector< int > &  asteroids 
)
static

在文件 leetcode.cpp380 行定义.

380 {
381 long long m = mass;
382 sort(asteroids.begin(), asteroids.end());
383 for(const int i: asteroids) {
384 if(m < i) {
385 return false;
386 }
387 m += i;
388 }
389 return true;
390 }

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


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