There was an error while loading. Please reload this page.
1 parent 0c011ad commit 8db7f2eCopy full SHA for 8db7f2e
1 file changed
leetcode3/최민지/4020-elevator-requests-i.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def elevatorRequests(self, n: int, requests: list[int]) -> int:
3
+ now = 0
4
+ result = 0
5
+ for req in requests:
6
+ result += abs(req - now)
7
+ now = req
8
+ return result
9
+
0 commit comments