mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 17:26:32 +08:00
init
This commit is contained in:
22
24/09/2860.h
Normal file
22
24/09/2860.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int countWays(vector<int> &nums) {
|
||||
sort(nums.begin(), nums.end());
|
||||
int count = 0;
|
||||
for (int i = 0; i <= nums.size(); i++) {
|
||||
if (i == 0) {
|
||||
if (nums[0] != 0) {
|
||||
count++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (i == nums.size() && i > nums[nums.size()]) {
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
if (i > nums[i - 1] && i < nums[i])count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
13
24/09/70.h
Normal file
13
24/09/70.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by 李洋 on 2024/9/7.
|
||||
//
|
||||
|
||||
#ifndef LEECODE_CPP_70_H
|
||||
#define LEECODE_CPP_70_H
|
||||
|
||||
//爬楼梯
|
||||
int climbStairs(int n) {
|
||||
|
||||
}
|
||||
|
||||
#endif //LEECODE_CPP_70_H
|
||||
Reference in New Issue
Block a user