奇安信: 1. 商场A 满三件六折,商场B 买二送一(送最便宜的),每件都必须买,求最少花费。如[[1,8,2], [4,3,5]] 输出 6 2. 蚂蚁找食物,从原点出发 找到所有食物的最小花费。80%超时了,类似蜜蜂采蜜 function distance (a,b) {     const [a1, a2] = a.split(',&(30872)#39;).map(Number), [b1,b2] = b.split(',&(30872)#39;).map(Number)     return Math.abs(a1-b1) + Math.abs(a2-b2) } function getTotalDistance (list, res=0) {     const todoList = ['0,0&(31488)#39;].concat(list)     for(let i=1; i<todoList.length; i++) {         res += distance(todoList[i-1], todoList[i])     }     return res } function getMinLen ( points, res=Infinity) {     // write code here     const len = points.length     const dfs = (stack) => {         if(stack.length === len) {             res = Math.min(res, getTotalDistance(stack))             return         }         for(let i=0; i<len; i++) {             const cur = points[i].join(',&(30872)#39;)             if(stack.includes(cur)) continue             stack.push(cur)             dfs(stack)             stack.pop()         }     }     dfs([])          return res }