Skip to content

Commit

Permalink
Time: 729 ms (82.65%), Space: 0B (100.00%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
joseantoniochacon committed Sep 30, 2024
1 parent 21181cb commit 58c9797
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Write your MySQL query statement below

SELECT person_name FROM (SELECT person_id, person_name, turn, weight, SUM(weight) over (ORDER BY turn) AS total_weight FROM Queue ORDER BY turn) TotalWeightTable WHERE total_weight <= 1000 ORDER BY total_weight DESC LIMIT 1;

0 comments on commit 58c9797

Please sign in to comment.