Skip to content

Commit 9d55017

Browse files
authored
Create day 03 solution in python
1 parent 58ba496 commit 9d55017

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Week_1_Day_03.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution:
2+
def twoCitySchedCost(self, costs: List[List[int]]) -> int:
3+
fcity = [i for i,j in costs]
4+
Diff = [j - i for i,j in costs]
5+
return sum(fcity) + sum(sorted(Diff)[:len(costs)//2])
6+

0 commit comments

Comments
 (0)