-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleetcode.h
46 lines (28 loc) · 896 Bytes
/
leetcode.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef LEETCODE_H
#define LEETCODE_H
#include <vector>
#include "tools.h"
#include "tree.h"
using namespace std;
class Solution {
public:
int minDepth(TreeNode* root);
int maxDepth(TreeNode* root);
bool isBalanced(TreeNode* root);
// binary search tree
int getMinimumDifference1(TreeNode* root);
int getMinimumDifference2(TreeNode* root);
int findPairs(vector<int>& nums, int k);
// to understand
int maxCoins(vector<int>& nums);
// All nodes of complete binary tree
int countNodes(TreeNode* root);
// todo
bool find132pattern(vector<int>& nums);
//
vector<int> addToArrayForm(vector<int>& A, int K);
int eraseOverlapIntervals(vector<vector<int>>& intervals);
int maximalSquare(vector<vector<char>>& matrix);
};
vector<int> getIndexSorted(vector<int>& v, int s, int e);
#endif