Skip to content

Commit 8333ff5

Browse files
committed
add 1769
1 parent bc13226 commit 8333ff5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""
2+
1769. Minimum Number of Operations to Move All Balls to Each Box
3+
4+
LeetCode Daily Quesiton for January 6, 2025
5+
6+
Runtime: 2922 ms (beats 18.68%)
7+
Memory: 17.99 MB (beats 33.80%)
8+
"""
9+
10+
class Solution:
11+
def minOperations(self, boxes: str) -> List[int]:
12+
return [sum(abs(i - j) for j in range(len(boxes)) if boxes[j] == '1') for i in range(len(boxes))]

0 commit comments

Comments
 (0)