8000 Merge pull request #1 from haoel/master · mzpbvsig/leetcode@f7c374f · GitHub
[go: up one dir, main page]

Skip to content

Commit f7c374f

Browse files
authored
Merge pull request haoel#1 from haoel/master
UpdateFromOrigin
2 parents 1a6c424 + 92562b3 commit f7c374f

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LeetCode
22
========
33

4-
###LeetCode Algorithm
4+
### LeetCode Algorithm
55

66
(Notes: "♥" means you need to buy a book from Leetcode)
77

@@ -328,7 +328,7 @@ LeetCode
328328
|1|[Two Sum](https://oj.leetcode.com/problems/two-sum/)| [C++](./algorithms/cpp/twoSum/twoSum.cpp)|Medium|
329329

330330

331-
###LeetCode Shell
331+
### LeetCode Shell
332332

333333

334334
| # | Title | Solution | Difficulty |
@@ -338,7 +338,8 @@ LeetCode
338338
|2|[Valid Phone Numbers](https://leetcode.com/problems/valid-phone-numbers/)| [Bash](./shell/ValidPhoneNumbers.sh)|Easy|
339339
|1|[Word Frequency](https://leetcode.com/problems/word-frequency/)| [Bash](./shell/WordFrequency.sh)|Medium|
340340

341-
###LintCode
341+
### LintCode
342+
342343
| # | Title | Solution | Difficulty |
343344
|---| ----- | -------- | ---------- |
344345
|1|[Search in a big sorted array](http://www.lintcode.com/en/problem/search-in-a-big-sorted-array/)|[Java](./algorithms/java/src/searchInABigSortedArray/searchInABigSortedArray.java)|Medium|

algorithms/cpp/3Sum/3Sum.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ using namespace std;
4747
vector<vector<int> > threeSum(vector<int> &num) {
4848

4949
vector< vector<int> > result;
50+
if(num.size()==0 || num.size()==1 || num.size() == 2) return result;
5051

5152
//sort the array, this is the key
5253
sort(num.begin(), num.end());

database/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### LeetCode Database
2+
3+
4+
| # | Title | Solution | Difficulty |
5+
|---| ----- | -------- | ---------- |
6+
|1|[Trips and Users](https://leetcode.com/problems/trips-and-users/)| [MySQL](./TripsAndUsers.sql)|Hard|

database/TripsAndUsers.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SELECT t.`Request_at` AS Day,
2+
ROUND(COUNT(CASE WHEN t.`Status` = 'cancelled_by_driver' OR t.`Status` = 'cancelled_by_client' THEN 1 END) / COUNT(*), 2) AS "Cancellation Rate"
3+
FROM Trips t
4+
INNER JOIN Users u
5+
ON t.Client_Id = u.Users_Id
6+
WHERE u.Banned = 'No'
7+
AND t.Request_at >= '2013-10-01'
8+
AND t.Request_at <= '2013-10-03'
9+
GROUP BY t.Request_at

0 commit comments

Comments
 (0)
0