File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
1
LeetCode
2
2
========
3
3
4
- ###LeetCode Algorithm
4
+ ### LeetCode Algorithm
5
5
6
6
(Notes: "&hearts ; " means you need to buy a book from Leetcode)
7
7
@@ -328,7 +328,7 @@ LeetCode
328
328
| 1| [ Two Sum] ( https://oj.leetcode.com/problems/two-sum/ ) | [ C++] ( ./algorithms/cpp/twoSum/twoSum.cpp ) | Medium|
329
329
330
330
331
- ###LeetCode Shell
331
+ ### LeetCode Shell
332
332
333
333
334
334
| # | Title | Solution | Difficulty |
@@ -338,7 +338,8 @@ LeetCode
338
338
| 2| [ Valid Phone Numbers] ( https://leetcode.com/problems/valid-phone-numbers/ ) | [ Bash] ( ./shell/ValidPhoneNumbers.sh ) | Easy|
339
339
| 1| [ Word Frequency] ( https://leetcode.com/problems/word-frequency/ ) | [ Bash] ( ./shell/WordFrequency.sh ) | Medium|
340
340
341
- ###LintCode
341
+ ### LintCode
342
+
342
343
| # | Title | Solution | Difficulty |
343
344
| ---| ----- | -------- | ---------- |
344
345
| 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|
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ using namespace std;
47
47
vector<vector<int > > threeSum (vector<int > &num) {
48
48
49
49
vector< vector<int > > result;
50
+ if (num.size ()==0 || num.size ()==1 || num.size () == 2 ) return result;
50
51
51
52
// sort the array, this is the key
52
53
sort (num.begin (), num.end ());
Original file line number Diff line number Diff line change
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|
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments