Skip to content

Commit e66c6e8

Browse files
committed
leetcode 177,178
2 parents 9f18c0a + ce09352 commit e66c6e8

File tree

28 files changed

+35
-343
lines changed

28 files changed

+35
-343
lines changed

lcof/面试题03. 数组中重复的数字/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class Solution:
3535
if num == nums[num]:
3636
return num
3737
nums[i], nums[num] = nums[num], nums[i]
38-
38+
num = nums[i]
39+
return -1
3940
```
4041

4142
### **Java**
@@ -96,4 +97,4 @@ func findRepeatNumber(nums []int) int {
9697
```
9798
9899
```
99-
<!-- tabs:end -->
100+
<!-- tabs:end -->

lcof/面试题03. 数组中重复的数字/Solution.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ def findRepeatNumber(self, nums: List[int]) -> int:
55
if num == nums[num]:
66
return num
77
nums[i], nums[num] = nums[num], nums[i]
8+
num = nums[i]
9+
return -1

solution/0100-0199/0175.Combine Two Tables/README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,10 @@ AddressId 是上表主键
4646

4747
<!-- tabs:start -->
4848

49-
### **Python3**
50-
<!-- 这里可写当前语言的特殊实现逻辑 -->
49+
### **SQL**
5150

52-
```python
53-
54-
```
55-
56-
### **Java**
57-
<!-- 这里可写当前语言的特殊实现逻辑 -->
58-
59-
```java
60-
61-
```
62-
63-
### **...**
6451
```
65-
52+
select p.FirstName, p.LastName, a.City, a.State from Person p left join Address a on p.PersonId = a.PersonId;
6653
```
6754

6855
<!-- tabs:end -->

solution/0100-0199/0175.Combine Two Tables/README_EN.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,12 @@ FirstName, LastName, City, State
7676

7777
## Solutions
7878

79-
8079
<!-- tabs:start -->
8180

82-
### **Python3**
83-
84-
```python
81+
### **SQL**
8582

8683
```
87-
88-
### **Java**
89-
90-
```java
91-
92-
```
93-
94-
### **...**
95-
```
96-
84+
select p.FirstName, p.LastName, a.City, a.State from Person p left join Address a on p.PersonId = a.PersonId;
9785
```
9886

9987
<!-- tabs:end -->

solution/0100-0199/0176.Second Highest Salary/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,8 @@
3232

3333
<!-- tabs:start -->
3434

35-
### **Python3**
36-
<!-- 这里可写当前语言的特殊实现逻辑 -->
35+
### **SQL**
3736

38-
```python
39-
40-
```
41-
42-
### **Java**
43-
<!-- 这里可写当前语言的特殊实现逻辑 -->
44-
45-
```java
46-
47-
```
48-
49-
### **sql**
5037
```
5138
select (select distinct Salary from Employee order by Salary desc limit 1 offset 1) as
5239
SecondHighestSalary;

solution/0100-0199/0176.Second Highest Salary/README_EN.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,8 @@
5353

5454
<!-- tabs:start -->
5555

56-
### **Python3**
56+
### **SQL**
5757

58-
```python
59-
60-
```
61-
62-
### **Java**
63-
64-
```java
65-
66-
```
67-
68-
### **sql**
6958
```
7059
select (select distinct Salary from Employee order by Salary desc limit 1 offset 1) as
7160
SecondHighestSalary;

solution/0100-0199/0177.Nth Highest Salary/README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,8 @@
3232

3333
<!-- tabs:start -->
3434

35-
### **Python3**
36-
<!-- 这里可写当前语言的特殊实现逻辑 -->
35+
### **SQL**
3736

38-
```python
39-
40-
```
41-
42-
### **Java**
43-
<!-- 这里可写当前语言的特殊实现逻辑 -->
44-
45-
```java
46-
47-
```
48-
49-
### **sql**
5037
```
5138
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
5239
BEGIN

solution/0100-0199/0177.Nth Highest Salary/README_EN.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,8 @@
5353

5454
<!-- tabs:start -->
5555

56-
### **Python3**
56+
### **SQL**
5757

58-
```python
59-
60-
```
61-
62-
### **Java**
63-
64-
```java
65-
66-
```
67-
68-
### **sql**
6958
```
7059
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
7160
BEGIN

solution/0100-0199/0178.Rank Scores/README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,14 @@
4040

4141
<!-- tabs:start -->
4242

43-
### **Python3**
44-
<!-- 这里可写当前语言的特殊实现逻辑 -->
43+
### **SQL**
4544

46-
```python
47-
48-
```
49-
50-
### **Java**
51-
<!-- 这里可写当前语言的特殊实现逻辑 -->
52-
53-
```java
54-
55-
```
56-
57-
### **sql**
5845
```
5946
select
6047
Score,
6148
(select count(*) from (select distinct Score s from Scores) tmp where s>=Score) Rank
6249
from Scores order by Rank;
50+
6351
```
6452

6553
<!-- tabs:end -->

solution/0100-0199/0178.Rank Scores/README_EN.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,14 @@
6969

7070
<!-- tabs:start -->
7171

72-
### **Python3**
72+
### **SQL**
7373

74-
```python
75-
76-
```
77-
78-
### **Java**
79-
80-
```java
81-
82-
```
83-
84-
### **sql**
8574
```
8675
select
8776
Score,
8877
(select count(*) from (select distinct Score s from Scores) tmp where s>=Score) Rank
8978
from Scores order by Rank;
79+
9080
```
9181

9282
<!-- tabs:end -->

0 commit comments

Comments
 (0)