-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgreedy_algs.h
32 lines (21 loc) · 887 Bytes
/
greedy_algs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef GREED_ALG_
#define GREED_ALG_
#include<vector>
#include <string>
namespace greedy {
// https://leetcode-cn.com/problems/advantage-shuffle/
std::vector<int> advantageCount(std::vector<int>& A, std::vector<int>& B);
// https://leetcode-cn.com/problems/jump-game/
bool canJump(std::vector<int>& nums);
// https://leetcode-cn.com/problems/jump-game-ii/
int jump(std::vector<int>& nums);
// https://leetcode-cn.com/problems/gas-station/
int canCompleteCircuit(std::vector<int>& gas, std::vector<int>& cost);
int canCompleteCircuit_v2(std::vector<int> &gas, std::vector<int> &cost);
// https://leetcode-cn.com/problems/wildcard-matching/
bool isMatch(std::string s, std::string p);
// https://leetcode-cn.com/problems/remove-duplicate-letters/
std::string removeDuplicateLetters(std::string s);
std::string removeDuplicateLetters_wrong(std::string s);
}
#endif // GREED_ALG_