File tree 3 files changed +66
-9
lines changed
3 files changed +66
-9
lines changed Original file line number Diff line number Diff line change 1
1
# 介绍
2
2
3
- 辛辛苦苦刷的` LeetCode ` 代码不展示出来,岂不对不起每天熬的夜和掉的头发。所以他来了,3分钟搭建属于自己的` LeetCode ` 展示平台 。
3
+ 辛辛苦苦刷的` LeetCode ` 代码不展示出来,岂不对不起每天熬的夜和掉的头发。所以他来了,3分钟搭建属于自己的` LeetCode ` 代码展示平台 。
4
4
5
5
# 效果
6
6
7
7
点击 [ https://ncdhz.github.io/leetcode/ ] ( https://ncdhz.github.io/leetcode/ ) 即可查看效果.
8
8
9
- 1 . 电脑版本效果
10
-
11
- ` Python ` 和` JavaScript ` 等菜单表示使用什么语言完成的算法,其中` Home ` 表示所有语言。` Title No:1-50 ` 表示编号为` 1-50 ` 的算法,` Number:1-10 ` 表示编号细分` 1-10 ` 的算法。搜索栏可以通过算法编号或者算法名字搜索对应的算法。
9
+ 1 . 电脑版本效果,` Python ` 和` JavaScript ` 等菜单表示使用什么语言完成的算法,其中` Home ` 表示所有语言。` Title No:1-50 ` 表示编号为` 1-50 ` 的算法,` Number:1-10 ` 表示编号细分` 1-10 ` 的算法。搜索栏可以通过算法编号或者算法名字搜索对应的算法。
12
10
13
11
<img src =" ./docs/images/computer.png " width =" 60% " />
14
12
15
13
16
- 2 . 手机版本效果
17
-
18
- 左图是手机端的页面,右图是手机端的菜单。
14
+ 2 . 手机版本效果,左图是手机端的页面,右图是手机端的菜单。
19
15
20
16
<img src =" ./docs/images/phone.png " width =" 30% " /><img src =" ./docs/images/phone_menu.png " width =" 30% " />
21
17
85
81
8 . 配置,配置文件在` web/src/config.ts ` 里,你可以更改里面的内容。
86
82
87
83
``` js
88
- github: " https://github.com/ncdhz/leetcode/" ,
89
84
{
85
+ // Github地址
86
+ github: " https://github.com/ncdhz/leetcode/" ,
90
87
// 你所使用的语言后缀,对应的语言名字。
91
88
codeMessage: {
92
89
// 语言后缀
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @lc app=leetcode.cn id=84 lang=cpp
3
+ *
4
+ * [84] 柱状图中最大的矩形
5
+ */
6
+
7
+ // @lc code=start
8
+ class Solution {
9
+ public:
10
+ int largestRectangleArea (vector<int >& heights) {
11
+ int ans = 0 ;
12
+ heights.push_back (0 );
13
+ heights.add ()
14
+ }
15
+ };
16
+ // @lc code=end
17
+
Original file line number Diff line number Diff line change 3
3
*
4
4
* [85] 最大矩形
5
5
*/
6
-
6
+ #include < unordered_map>
7
+ #include < vector>
8
+ #include < tuple>
9
+ using namespace std ;
7
10
// @lc code=start
8
11
class Solution {
9
12
public:
10
13
int maximalRectangle (vector<vector<char >>& matrix) {
14
+ unordered_map<int , vector<tuple<int , int >>> map;
15
+ for (int i = 0 ; i < matrix.size (); i++) {
16
+ int s = -1 ;
17
+ int j = 0 ;
18
+ for (; j < matrix[i].size (); j++) {
19
+ if (matrix[i][j] == 0 ) {
20
+ if (s != -1 ) {
21
+ if (map.count (i) == 0 ) {
22
+ vector<tuple<int , int >> ve;
23
+ ve.push_back (make_tuple (s, j));
24
+ map.emplace (i, ve);
25
+ } else {
26
+ vector<tuple<int , int >> ve = map.at (i);
27
+ ve.push_back (make_tuple (s, j));
28
+ }
29
+ s = -1 ;
30
+ }
31
+ } else {
32
+ if (s == -1 ) {
33
+ s = j;
34
+ }
35
+ }
36
+ }
37
+ if (s != -1 ) {
38
+ if (map.count (i) == 0 ) {
39
+ vector<tuple<int , int >> ve;
40
+ ve.push_back (make_tuple (s, j));
41
+ map.emplace (i, ve);
42
+ } else {
43
+ vector<tuple<int , int >> ve = map.at (i);
44
+ ve.push_back (make_tuple (s, j));
45
+ }
46
+ s = -1 ;
47
+ }
48
+ }
11
49
50
+ for (int i = 0 ; i < matrix.size () ; i++) {
51
+ for (int j = i + 1 ; j < matrix[i].size () ; j++) {
52
+
53
+ }
54
+ }
12
55
}
13
56
};
14
57
// @lc code=end
You can’t perform that action at this time.
0 commit comments