Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 387 Bytes

553.md

File metadata and controls

26 lines (17 loc) · 387 Bytes

553 Optimal Division

Description

link


Solution

  • See Code

Code

class Solution:
    def optimalDivision(self, nums: List[int]) -> str:
        A = list(map(str, nums))
        if len(A) <= 2:
            return '/'.join(A)
        return A[0] + '/(' + '/'.join(A[1:]) + ')'