There was an error while loading. Please reload this page.
2 parents ca21462 + 8db7f2e commit 2b83cd8Copy full SHA for 2b83cd8
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