Skip to content

Commit 7beded5

Browse files
authored
Create 3560. Find Minimum Log Transportation Cost.py
1 parent c463cfd commit 7beded5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def minCuttingCost(self, n: int, m: int, k: int) -> int:
3+
4+
def split_cost(length):
5+
cost = 0
6+
while length > k:
7+
remain = length - k
8+
cost += k * remain
9+
length = remain
10+
return cost
11+
12+
return split_cost(n) + split_cost(m)

0 commit comments

Comments
 (0)