We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7525bd9 commit 15fa32fCopy full SHA for 15fa32f
Math/553.md
@@ -0,0 +1,26 @@
1
+## 553 Optimal Division
2
+
3
+#### Description
4
5
+[link](https://leetcode.com/problems/optimal-division/)
6
7
+---
8
9
+#### Solution
10
11
+- See Code
12
13
14
15
+#### Code
16
17
+<!-- O(n) -->
18
19
+```python
20
+class Solution:
21
+ def optimalDivision(self, nums: List[int]) -> str:
22
+ A = list(map(str, nums))
23
+ if len(A) <= 2:
24
+ return '/'.join(A)
25
+ return A[0] + '/(' + '/'.join(A[1:]) + ')'
26
+```
0 commit comments