package leetcode;

/**
 * https://leetcode.com/problems/optimal-division/
 */
public class Problem553 {
    public String optimalDivision(int[] nums) {
        // TODO
        return "";
    }

    public static void main(String[] args) {
        Problem553 prob = new Problem553();
        System.out.println(prob.optimalDivision(new int[]{1000, 100, 10, 2})); // 1000/(100/10/2)
    }
}

@@ -157,24 +157,43 @@
     
-// TODO%0A
+if (nums.length == 1) %7B%0A   
         
 retu
@@ -192,212 +192,447 @@
     
+ 
 return 
-%22%22;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem553 prob = new Problem553();%0A        System.out.println(prob.optimalDivision(new int%5B%5D%7B1000, 100, 10, 2%7D)); // 1000/(100/10/2)
+Integer.toString(nums%5B0%5D);%0A        %7D else if (nums.length == 2) %7B%0A            return nums%5B0%5D + %22/%22 + nums%5B1%5D;%0A        %7D%0A        String result = Integer.toString(nums%5B0%5D) + %22/(%22;%0A        for (int i = 2; i %3C nums.length; i++) %7B%0A            if (i + 1 %3C nums.length) %7B%0A                result += nums%5Bi%5D + %22/%22;%0A            %7D else %7B%0A                result += nums%5Bi%5D;%0A            %7D%0A        %7D%0A        result += %22)%22;%0A        return result;
 %0A   

Solve problem 553