1 parent c1c79bb commit 60c01cbCopy full SHA for 60c01cb
2 files changed
leetcode3/최민지/4024.py
@@ -0,0 +1,20 @@
1
+class Solution:
2
+ def nearestDrone(self, drones: list[list[int]], target: list[int]) -> int:
3
+ result = []
4
+ for drone in drones:
5
+ s = drone[0]
6
+ e = drone[1]
7
+ r = drone[2]
8
+ temp = abs(s - target[0]) + abs(e - target[1])
9
+ if temp <= r:
10
+ result.append(temp)
11
+ else:
12
+ result.append(100)
13
+
14
15
+ output = min(result)
16
+ if output != 100:
17
+ return result.index(output)
18
19
+ return -1
20
leetcode3/최민지/907.py
@@ -0,0 +1,9 @@
+ def sumSubarrayMins(self, arr: List[int]) -> int:
+ for i in range(1, len(arr)+1):
+ for j in range(0, i):
+ temp = arr[j:j+i]
+ result.append(min(temp))
+ return sum(result) % ( 10**9 + 7 )
0 commit comments