Skip to content

Commit 85812d1

Browse files
committed
add code
1 parent 4c250d2 commit 85812d1

5 files changed

+50
-1
lines changed

code/123.买卖股票的最佳时机-iii.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
// @lc code=start
88
class Solution {
99
public int maxProfit(int[] prices) {
10-
10+
int buy1 = -prices[0];
11+
int buy2 = -prices[0];
12+
int sell1 = 0;
13+
int sell2 = 0;
14+
for (int i = 1; i < prices.length; i++) {
15+
buy1 = Math.max(buy1, -prices[i]);
16+
sell1 = Math.max(sell1, buy1 + prices[i]);
17+
buy2 = Math.max(buy2, sell1 - prices[i]);
18+
sell2 = Math.max(sell2, buy2 + prices[i]);
19+
}
20+
return sell2;
1121
}
1222
}
1323
// @lc code=end

code/174.地下城游戏.java

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* @lc app=leetcode.cn id=174 lang=java
3+
*
4+
* [174] 地下城游戏
5+
*/
6+
7+
// @lc code=start
8+
class Solution {
9+
public int calculateMinimumHP(int[][] dungeon) {
10+
11+
}
12+
}
13+
// @lc code=end
14+

code/175.组合两个表.sql

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--
2+
-- @lc app=leetcode.cn id=175 lang=mysql
3+
--
4+
-- [175] 组合两个表
5+
--
6+
7+
-- @lc code=start
8+
# Write your MySQL query statement below
9+
select firstName, lastName, city, state from Person left join Address on Person.PersonId = Address.PersonId
10+
-- @lc code=end
11+

code/176.第二高的薪水.sql

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--
2+
-- @lc app=leetcode.cn id=176 lang=mysql
3+
--
4+
-- [176] 第二高的薪水
5+
--
6+
7+
-- @lc code=start
8+
# Write your MySQL query statement below
9+
select ifnull((select max(salary) from Employee where salary < (select max(salary) from Employee)), NULL) as SecondHighestSalary;
10+
-- @lc code=end
11+

web/src/config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export default {
5252
go: {
5353
name: "Go",
5454
},
55+
sql: {
56+
name: "SQL"
57+
}
5558
},
5659
itemSpace: 10,
5760
menuSpace: 5,

0 commit comments

Comments
 (0)