Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit991bc56

Browse files
committed
Update README.md
1 parentcc91e5d commit991bc56

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,4 +515,21 @@ FROM Accounts
515515
UNION
516516
SELECT'High Salary'AS category,SUM(IF(income>50000,1,0))AS accounts_count
517517
FROM Accounts
518+
```
519+
520+
[1204. Last Person to Fit in the Bus](https://leetcode.com/problems/last-person-to-fit-in-the-bus/)
521+
```sql
522+
-- 1000 kg limit
523+
-- name of last person
524+
525+
WITH CTEAS (
526+
SELECT person_name, weight, turn,SUM(weight)
527+
OVER(ORDER BY turn)AS total_weight
528+
FROM Queue
529+
)
530+
SELECT person_name
531+
FROM cte
532+
WHERE total_weight<=1000
533+
ORDER BY total_weightDESC
534+
LIMIT1;
518535
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp