Is there something wrong with my understanding? Just so Easy?


  • 0
    J
    /**
     * @param {number[]} nums
     * @return {string}
     */
    var optimalDivision = function(nums) {
      let len = nums.length;
      if (len > 2) {
        nums[1] = '(' + nums[1];
        nums[len - 1] = nums[len - 1] + ')';
      }
      return nums.join('/');
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.